Sunday , December 11 2016
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.
Also See:   Restrict Mouse Pointer Position C Graphics Program

Check Also

Hide Mouse Pointer C Program

How to Hide a Mouse Pointer Program in C : This program will show and hide ...

Leave a Reply

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

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