Ad Code

NEW POST

6/recent/ticker-posts

SRM ELAB PROBLEM: The Matriculation school have arranged an Annual Day Function.

The Matriculation school have arranged an Annual Day Function.

 

#include <stdio.h>

int main()

{

int rows;

int i,j;

scanf("%d",&rows);

for(i=1;i<=rows;i++)

{

    for(j=1;j<=i;j++)

    {

        if(i==1||j==1||i==rows||i==j)

        {

            printf("1 ");

        }

        else

        {

            printf("0 ");

        }

    }

    printf("\n");

}

return 0;

}

Post a Comment

0 Comments