Logo 
Search:

C Programming Articles

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

Program to print pyramid of * (starts) in reverse pattern

Posted By: Hannah Mcdonald     Category: C Programming     Views: 25004

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

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

consider space in place of line.

Code for Program to print pyramid of * (starts) 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 of * (starts) in reverse pattern Or get search suggestion and latest updates.

Hannah Mcdonald
Hannah Mcdonald author of Program to print pyramid of * (starts) in reverse pattern is from Chicago, United States.
 
View All Articles

 
Please enter your Comment

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

 
No Comment Found, Be the First to post comment!