Star printing program in c, Pattern 6

Pattern 6:




Discussion:

Reverse form of pattern 2. Using scanf() function to take user input.



Code:

#include <stdio.h>

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

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

         printf("\n");
    }

    return 0;
}

Return to:

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

Previous pattern                                                                                                        Next pattern

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