#include
main()
{
int number = 1, n, c, k;
clrscr();
printf("Enter number of rows::");
scanf("%d",&n);
for ( c = 1 ; c <= n ; c++ )
{
for( k = 1 ; k <= c ; k++ )
{
printf("%d ", number);
number++;
}
number = 1;
printf("\n");
}
getch();
return 0;
}
---------------------------------
output:-
Enter number of rows::5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
No comments:
Post a Comment