C++ Program to draw a snail (Simple Graphics)

#include <iostream.h>
#include <conio.h>
#include <graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\Tc\\BGI");
setcolor(GREEN);
setfillstyle(SOLID_FILL,YELLOW);
circle(300,150,20);
floodfill(300,150,GREEN);
circle(300,190,19);
floodfill(300,190,GREEN);
circle(300,228,18);
floodfill(300,228,GREEN);
circle(263,230,19);
floodfill(265,230,GREEN);
circle(227,230,17);
floodfill(231,230,GREEN);
circle(198,230,12);
floodfill(202,230,GREEN);
line(280,120,289,135);
setfillstyle(SOLID_FILL,GREEN);
circle(280,115,5);
floodfill(280,115,GREEN);
line(310,115,305,130);
circle(310,110,5);
floodfill(310,110,GREEN);
setfillstyle(SOLID_FILL,BROWN);
circle(292,140,2);
floodfill(292,140,GREEN);
circle(300,140,2);
floodfill(300,140,GREEN);
arc(295,150,180,360,5);
circle(220,185,30);
circle(220,185,26);
circle(220,185,21);
circle(220,185,10);
circle(220,185,13);
circle(220,185,6);
getch();
closegraph();
}

Output

0 comments:

Post a Comment