TEAM CODING-BCA

C Program for Drawing a Kite and Color it

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();
}
Output

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. The above program is wrong..

    line(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.

    ReplyDelete
  3. Yes u r right. . Thnks preethi

    ReplyDelete