Draw an Indian musical instrument "Dholak"



Here we are going to learn C-graphics code for drawing a commonly used musical instrument "Dholak".It is very easy to draw.You can draw this with the help of some simple functions of c-graphics.So go throught the following code to draw dholak:

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

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

ellipse(200,185,0,360,30,60);

ellipse(400,185,0,360,30,60);

ellipse(200,185,0,360,10,20);

ellipse(400,185,0,360,10,20);

ellipse(200,185,0,360,20,40);

ellipse(400,185,0,360,20,40);

ellipse(300,140,0,180,120,30);

ellipse(300,230,180,360,120,30);

ellipse(372,265,90,160,182,50);

ellipse(376,260,90,160,180,50);

ellipse(374,210,90,140,186,50);

ellipse(374,207,90,140,186,50);

setfillstyle(SOLID_FILL,WHITE);

floodfill(200,185,WHITE);

floodfill(400,185,WHITE);

settextstyle(1,HORIZ_DIR,3);

outtextxy(250,300,"(DHOLAK)");

getch();

closegraph();

}



Above code is used to draw a musical instrument dholak on output screen.You can draw this instrument using ellipse function of c-graphics.settextstyle function is used to set the pattern of text and outtextxy function is used to write text at a specified location.setfillstyle and floodfill functions are used to set the fill style and fill the color respectively.You can learn these functions in detail in our tutorial Graphics in C.The output of the above code is as follows:



Output

c_graphics