Floyd's Triangle

 /*

    Floyd's Triangle

1

2 3

4 5 6

7 8 9 10

*/


#include <stdio.h>

int 

main () 

{

int n, row, column, nfrows, no = 1;


     printf("Enter number of rows\n");

     scanf("%d", &nfrows);


    for (row = 1; row <= nfrows; row++)

    {

        for (column = 1; column <= row; column++)

        {

           printf ("%d ", no);

            no++;

        }

    printf("\n");

    }

    return 0;

}



Comments