technicalsymposium

Google Search-Search in Our Website

Search Freshers Jobs/Conferences/Placement Materials/ All Engineering Branches Lecture Notes and
GATE/All Universities Question Papers in Our Website. Enter your Query & Search Below

Programming Codes with Answers

C PROGRAM FOR PASCAL TRIANGLE.

#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,j,num,x=1;
clrscr();
printf("Please Enter the Number :");
scanf("%d",&num);
printf("\n\n");
printf("OUTPUT:\n");
printf("------");
printf("\n\n");
printf("The Pascal triangle is\n");
printf("**********************\n");
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
if(j==1)
{
x=1;
printf("%d",x);
}
else
{
x=(x*(i-j+1)/(j-1));
printf("%d",x);
}
}
printf("\n");
}
getch();
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com