Draw a colorful kite



You can easily draw various beautiful and colorful objects by using c-graphics programming.Here we are going to draw a colorful kite with the help of basic functions of c-graphics.The code for drawing colorful kite in c-graphics is given below:

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

initgraph(&gd,&gm,"");

setlinestyle(0,0,2);

line(220,200,340,200);

line(280,150,280,300);

line(220,200,280,150);

line(340,200,280,300);

line(280,150,340,200);

line(220,200,280,300);

line(275,155,273,157);

setfillstyle(SOLID_FILL,RED);

floodfill(240,190,WHITE);

setfillstyle(SOLID_FILL,YELLOW);

floodfill(320,190,WHITE);

setfillstyle(SOLID_FILL,BLUE);

floodfill(240,210,WHITE);

setfillstyle(SOLID_FILL,GREEN);

floodfill(320,210,WHITE);

setcolor(LIGHTCYAN);

line(280,300,260,340);

line(280,300,300,340);

setcolor(MAGENTA);

settextstyle(1,HORIZ_DIR,4);

outtextxy(350,250,"KITE");

getch();

closegraph();

}



The above code is responsible for drawing a colorful kite on your output screen.We are using simple line function for drawing a kite.setfillstyle and floodfill functions are used for deciding the fill pattern and filling the color respectively.settextstyle functions sets the text pattern and outtextxy function is used to write text at specified location.You can learn all these function in our tutorial Graphics in C.The output of the above program will be as follows:



Output

c_graphics