You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
283 B

#include<stdio.h>
int main()
{
int a[10][10],i,j;
a[0][0]=1;
for(i=0;i<10;i++)
{
for(j=0;j<=i;j++)
{
if(j==0||j==i)
a[i][j]=1;
else
a[i][j]=a[i-1][j-1]+a[i-1][j];
printf("%d",a[i][j]);
if(j!=i)
printf(" ");
}
if(i<9)
printf("\n");
}
return 0;
}