38. Write a j program to display following output on the screen.
1
1 2
1 2 3
1 2 3 4
#include <stdio.h>
#include <conio.h>
void main()
{
int n, i, j;
// clrscr();
printf("Enter Rows : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d ", j);
}
printf("\n");
}
}
Output
Enter Rows : 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5