Code:
#include stdio.h
main( )
{
int i, j, k = 1;
printf("floyds triangle is\n");
for( i = 1; k <= 20; ++i )
{
for( j = 1; j <= i; ++j )
printf( "%d ", k++ );
printf( "\n\n" );
}
return 0;
}
Output:
floyds triangle is
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
More C Programs: