Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

how to print this :
    1
   11
  121
 1331
14641

using for loop
void main()
{
int a[10][10],i,j;
for(i=0;i<10;++i)
  {

   printf("
");
   for(j=0;j<=i;++j)
   {
     if(j==0 || i==j)
      a[i][j]=1;
      else
       a[i][j]=a[i-1][j-1]+a[i-1][j];
       printf("%4d",a[i][j]);

   }
  }



}