Thursday, 16 November 2017

C Program to Display Floyd’s triangle


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:












100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...