Star printing program in c, Pattern 5

Pattern 5:



Discussion: 

Reverse form of pattern pattern 1. It's take user input to print stars.

Code:


#include <stdio.h>

int main()
{
    int n, i, k, j;
    printf("how many row u wnt : ");
    scanf("%d", &n);
    for(i=1;i<=n;i++)
    {
        for(k=0;k<=n-i;k++)
        {
             printf(" ");
        }

       for(j=n;j>=k;j--)
       {
           printf("*");
       }

         printf("\n");
    }

    return 0;
}

Return to:

How to print stars pattern (" * ") in C ?

Previous pattern                                                                                                             Next pattern


Star printing program in c, pattern 5. How to print star in java and c programming.How to print star in java and c code. star printing code in c.