Code

# include <graphics.h>
# include <conio.h>
# include <iostream.h>
# include <dos.h>
void get_driver()
{
    int gDriver=DETECT,gMode; // define variables
    initgraph(&gDriver,&gMode,"c:\\tc\\bgi");  // initialize graphics Library 
}
void main()
{
get_driver();
int i,polyarray[30];
setcolor(LIGHTCYAN);
drawpoly(15,polyarray);
polyarray[0]=0;
polyarray[1]=200;
polyarray[2]=50;
polyarray[3]=300;
polyarray[4]=250;
polyarray[5]=300;
polyarray[6]=400;
polyarray[7]=250;
polyarray[8]=325;
polyarray[9]=225;
polyarray[10]=325;
polyarray[11]=175;
polyarray[12]=300;
polyarray[13]=200;
polyarray[14]=200;
polyarray[15]=150;
polyarray[16]=275;
polyarray[17]=115;
polyarray[18]=300;
polyarray[19]=125;
polyarray[20]=300;
polyarray[21]=100;
polyarray[22]=200;
polyarray[23]=50;
polyarray[24]=200;
polyarray[25]=50;
polyarray[26]=100;
polyarray[27]=100;
polyarray[28]=0;
polyarray[29]=100;
setcolor(LIGHTCYAN);
drawpoly(16,polyarray);
getch();
fillpoly(15,polyarray);
setcolor(LIGHTRED);
ellipse(200,100,90,270,20,10);
circle(200,100,10);
getch();
closegraph();
}

OUTPUT

Polygon
Polygon
Polygon
Polygon

 

 

(Visited 65 times, 1 visits today)
Share with Friends :
Written by:

Leave a Reply

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