C Program to print numeric pyramid-II

/* Pyramid Traingle
              *******
               ******
                 ***
                   *
*/

#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:


No comments:

Post a Comment

100 C Programs with Code and Output

Program 1: C Program To Read Two Numbers And Print The Sum Of Given Two Numbers. Program 2: C Program To Read Three Numbers And Prin...