Draw a sketch of bag



Here We are going to draw sketch of bag using c-graphics functions.You can easily create this by having some basic knowledge of c-graphics functions.Here is a code for this:

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

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

setbkcolor(WHITE);

setcolor(DARKGRAY);

ellipse(245,250,0,180,40,170);

ellipse(245,250,0,180,30,150);

line(170,250,320,250);

ellipse(247,250,180,0,75,10);

line(170,250,170,140);

line(170,140,215,140);

line(170,160,212,160);

line(170,163,212,163);

line(170,143,215,143);

line(224,140,266,140);

line(224,143,266,143);

line(222,160,268,160);

line(222,163,268,163);

line(276,140,320,140);

line(276,143,320,143);

line(278,160,320,160);

line(278,163,320,163);

line(320,250,320,140);

getch();

closegraph();

}



The above code is used to draw a sketch of bag on your output screen. In the above code we have used line and ellipse functions to draw bag. You can study these functions from our tutorial Graphics in C.The output of the above code is as follows:



Output

c_graphics