programming-examples/c/Functions/C Program to Display Floyd’s triangle.c

17 lines
325 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C Program to Display Floyds triangle
*/
#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;
}