Advertisement

PATTERN "PYRAMID" PROGROM

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d;
printf("HOW MANY ROW PYRAMID YOU WANT\n\n");
scanf("%d" ,&c);
d=c;
for(a=1;a<=c;a++)
{
for(b=1;b<=d;b++)
printf(" ");
d--;
for(b=1;b<=2*a-1;b++)
printf("*");
printf("\n");
}
getch();
}
//output       *
//            ***
//           *****
//          *******

Post a Comment

0 Comments