Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to print pyramid in reverse pattern

Posted By: Adali Fischer     Category: C Programming     Views: 19938

WRITE A PROGRAM TO GENERATE FOLLOWING FIGURE OF N LINES. INPUT N FROM KEYBOARD.

* * * * * * *
__* * * * *
____* * *
______*

consider space in place of line.

Code for Program to print pyramid in reverse pattern in C Programming

#include<stdio.h>
#include<conio.h>
void main()
{
    int i,n,j;
    clrscr();
    printf("\n Please Give The Value of N:  ");
    scanf("%d",&n);
    for(i=n;i>0;i--)
    {
        for(j=n-i;j>0;j--)
            printf("  ");
        for(j=2*i-1;j>0;j--)
            printf(" *");
        printf("\n");
    }
    getch();
}




****************************** OUTPUT *********************************




 Please Give The Value of N:  8


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


  
Share: 


Didn't find what you were looking for? Find more on Program to print pyramid in reverse pattern Or get search suggestion and latest updates.

Adali Fischer
Adali Fischer author of Program to print pyramid in reverse pattern is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Chahat Verma from India Comment on: Nov 10
cn i get the program for printing the pyramid like
*
* *
* * *
* * * *
* * *
* *
*

View All Comments