C Program for Drawing a Kite and Color it :
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd,gm;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
line(200,200,300,100);
line(300,100,400,200);
line(400,200,300,300);
line(300,100,300,300);
arc(300,300,45,135,140);
setfillstyle(SOLID_FILL,BLUE);
floodfill(301,105,WHITE);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(299,105,WHITE);
setfillstyle(SOLID_FILL,BLUE);
floodfill(299,275,WHITE);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(301,275,WHITE);
line(300,300,250,350);
line(250,350,350,350);
line(300,300,350,350);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(300,310,WHITE);
getch();
closegraph();
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd,gm;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
line(200,200,300,100);
line(300,100,400,200);
line(400,200,300,300);
line(300,100,300,300);
arc(300,300,45,135,140);
setfillstyle(SOLID_FILL,BLUE);
floodfill(301,105,WHITE);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(299,105,WHITE);
setfillstyle(SOLID_FILL,BLUE);
floodfill(299,275,WHITE);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(301,275,WHITE);
line(300,300,250,350);
line(250,350,350,350);
line(300,300,350,350);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(300,310,WHITE);
getch();
closegraph();
}
Output |
This comment has been removed by the author.
ReplyDeleteThe above program is wrong..
ReplyDeleteline(200,200,300,100);
line(300,100,400,200);
line(400,200,300,300);
line(300,100,300,300);
After this, a line of code has to be added
line(300,300,200,200);
To make the code correct.
Yes u r right. . Thnks preethi
ReplyDeleteplease repeat your code because kite color is All colors are the same
ReplyDelete