Multidimensional Array_1.4

#include <stdio.h>
int main()
{
    int a[25][25],i,j,k=1;
    for(i=1;i<=6;i++)
    {
      for(j=1;j<=7-i;j++)
      {
         a[i][j]=k;
         k++;
      }
       k=1;
    }

    for(i=1;i<=6;i++)
    {
      for(j=1;j<=7-i;j++)
      {
          printf("%d",a[i][j]);
      }
          printf("\n");
    }
    system("pause");
    return 0;
}


This is the output:
123456
12345
1234
123
12
1

0 comments:

Post a Comment