answersLogoWhite

0

Show the 100th pascals triangle

Updated: 12/13/2022
User Avatar

Wiki User

14y ago

Best Answer

#include<stdio.h>

void main()

{

int num,x,y,a[50][50];

clrscr();

fflush(stdin);

printf("Enter the number of rows: ");

scanf("%d",&num);

printf("\n\t\tPascal's Triangle of Order %d\n\n",num);

for(x=0;x<num;x++)

{

for(y=0;y<=x;y++)

{

if(x==y y==0)

a[x][y]=1;

else

a[x][y]=a[x-1][y-1]+a[x-1][y];

printf("%4d",a[x][y]);

}

printf("\n\n");

}

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Show the 100th pascals triangle
Write your answer...
Submit
Still have questions?
magnify glass
imp