Pattern #4

pattern


Program:

#include <stdio.h>


void main()

{

    int i, j, k;

    

    for(i=4;i>=0;i--)

    {

        for(k=1;k<=i;k++)

        {

            printf(" ");

        }

        for(j=k;j<=5;j++)

        {

            printf("*");

        }

        printf("\n");

    }

}


Output:

    *

   **

  ***

 ****

*****


Drafted on 🌏 by,

Jal


peace

Comments

Popular posts from this blog

C program to read and display book information using structure

Count positive, negative and zero values in an array

Maximum value from array