C Program to Print Inverted Full Pyramid Using *


Aim :- Write a C Program to Print Inverted Full Pyramid Using *.

C program to For Generating Inverted Full Pyramid Using *.
The Number of Rows Will Be Given By User.


C++ Program Code :


#include<stdio.h>
#include<conio.h>
void main()
{
      int n, i, j, k;
      clrscr();

      printf("\nC Program To Print Full Inverted Pyramid Using *.");
      printf("\n\nEnter Number of Rows : ");
      scanf("%d",&n);

      for(i=n; i>=1; --i)
      {

            for(k=0; k < n-i; ++k)
            {
                  printf("  ");
            }

            for(j=i; j <= 2*i-1; ++j)
            {
                  printf("* ");
            }

            for(j=0; j < i-1; ++j)
            {
                  printf("* ");
            }

      printf("\n");
      }

      getch();
}


Output :

Post a Comment

0 Comments