-->

Header Ads

Pyramid Program 5



C Program:

#include
#include
void main()
{
int a,b,n;
clrscr();
printf("Enter  hieght of pyramid : ");
scanf("%d",&n);
for(a=0;a=a;b--)
       {
	 cprintf("* ");
       }
printf("\n");
}
for(a=0;a<=n;a++)
{
      for(b=n;b>=a;b--)
       {
       textcolor(RED);
	cprintf(".");
       }
      for(b=0;b<=a;b++)
     {
       cprintf("* ");
      }
printf("\n");
}
getch();
}



Output of c program:


No comments

Powered by Blogger.