Click the Follow Button

C: Pyramid of *

 PROGRAM:

// *
// ***
// *****
// *******

#include<stdio.h>

int main ()
{
    int n = 4;
    for(int i = 1; i <= n; i++ )
    {
        // print (i + 1) *
        for (int j = 1; j <= 2*i - 1; j++)
        {
            printf("*");
        }
        printf("\n");
       
    }

    return 0;
}

OUTPUT:

                 *

                 ***

                 *****

                 *******

Comments

Popular Posts

TIC - TAC - TOE

Prime and not prime number

do_while loop is to do something again and again