Home / C / Program in C to Draw a Pyramid

Program in C to Draw a Pyramid

#include
#include
#include
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,”c:\\tc\\bgi”);
setcolor(150);
line(100,150,300,150);
line(100,150,100,300);
line(100,300,300,300);
line(300,300,300,150);
line(100,150,200,0);
line(300,150,200,0);
line(100,300,200,0);
line(300,300,200,0);
getch();
closegraph();
}
 

OUTPUT:

 
 
Tags: c program to draw a pyramid, c graphics program to draw a pyramid.

Check Also

Restrict Mouse Pointer Position C Graphics Program

This C Program will restrict the Mouse Pointer location or to a particular position or x,y ...

Leave a Reply

Your email address will not be published. Required fields are marked *

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.