Problem Description: saravanan with his friends going to the theatre for a movie. The seating arrangement is triangular in size. Theatre staffs insisted the audience to sit in odd row if the seat number is odd and in even row if the seat number is even. But the instruction is very confusing for saravanan and his friends. So help them with the seating layout so that they can sit in correct seats. Constraints: 4 ≤ N ≤ 20 Input Format: Only line of input has single integer value representing the number of rows in the theatre. Output Format: Print the layout based on the number of rows specified in input. Refer sample testcases for format specification.
C Program


#include<stdio.h>

int main()

{

int N,i,j,x;

scanf("%d",&N);

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

{

if(i%2==1) x=1;

else x=2;

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

{

printf("%d ",x);

x+=2;

}

printf("\n");

}

return 0;

}