C Programming Code Examples C > Pyramid Patterns Code Examples Floyd's Triangle Program In C Floyd's Triangle Program In C Floyd's triangle, named after Rober Floyd, is a right angled triangle, which is made using natural numbers. It starts from 1 and consecutively selects the next greater number in sequence. #include <stdio.h> int main() { int n,x,j,k=1; n = 5; for(x = 1; x <= n; x++) { for(j=1;j <= x; j++) printf("%3d", k++); printf("\n"); } return 0; } procedure floyds_triangle FOR x = 1 to N DO FOR J = 1 to x DO PRINT K INCREMENT K END FOR PRINT NEWLINE END FOR end procedure