Patter 6: reverse pyramid star program in c

Spread the love

Write a C Program to print below pattern ( Pyramid Star pattern ) :

* * * * * 
 * * * * 
  * * *
   * * 
    *

Program :

  1. #include<stdio.h>
  2. int main()
  3. {
  4.    int i,j,n;
  5.    printf(“Enter how many rows you want : “);
  6.    scanf(“%d”,&n);
  7.  
  8.    for(i=n;i>=1;i)
  9.    {
  10.         for(j=1;j<=ni;j++)
  11.                 printf(” “); // one space.
  12.  
  13.         for(j=1;j<=i;j++)
  14.                 printf(“* “); // one star and one space.
  15.  
  16.       printf(n);
  17.    }
  18.    return 0;
  19. }

Output :

Similar Star pattern programs:

More C programs:

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer, Presently working as a Software Engineer. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

1 Response

  1. sandeep.vattepu says:

    how can we print inverse pyramid with numbers

Leave a Reply