#include<iostream.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm,x,y,i,pts1[]={100,100,50,150,150,150,100,100};
int pts2[]={80,220,180,220,150,270,50,270,80,220};
int pts3[]={240,190,200,230,240,270,280,230,240,190};
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
x=getmaxx()/2;y=getmaxy()/2;
setlinestyle(2,1,3);
setcolor(1);
drawpoly(4,pts1);
outtextxy(70,160,"TRIANGLE");
getch();
setcolor(2);
circle(225,100,50);
outtextxy(205,160,"CIRCLE");
getch();
setcolor(3);
rectangle(315,100,415,150);
outtextxy(330,160,"RECTANGLE");
getch();
setcolor(4);
rectangle(440,50,540,150);
outtextxy(465,160,"SQUARE");
getch();
setcolor(5);
drawpoly(5,pts2);
outtextxy(50,280,"PARALLELOGRAM");
getch();
setcolor(6);
drawpoly(5,pts3);
outtextxy(215,280,"RHOMBUS");
getch();
setcolor(7);
ellipse(360,260,0,360,40,10);
line(360,190,320,260);
line(360,190,400,260);
outtextxy(345,280,"CONE");
getch();
setcolor(8);
ellipse(490,260,0,360,40,10);
ellipse(490,190,0,360,40,10);
line(450,190,450,260);
line(530,190,530,260);
outtextxy(460,280,"CYLINDER");
getch();
closegraph();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.