Technicalsymposium



Join Our Email Alerts-Subscribe
Important Note:Login & Check Your Email Inbox and Activate Confirmation Link


Enter Your Email :

C PROGRAM FOR PASCAL TRIANGLE.

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();

}


All Programming Codes/Onlie Training/ Lab Manuals Download