// C Programs - eitworld


Create a Teddy Bear



Here we are here again with a amazing tip of c-graphics.This will tell you how can you create a teddy bear by using simple c-graphics functions.To learn to draw a teddy bear in c go through the following code:

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

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

setbkcolor(WHITE);

setcolor(LIGHTRED);

ellipse(300,150,0,360,70,60);

ellipse(300,260,0,360,80,75);

circle(220,122,30);

circle(380,122,30);

circle(280,140,8);

circle(320,140,8);

ellipse(300,172,0,360,28,25);

ellipse(300,168,0,360,8,6);

line(300,174,300,179);

ellipse(292,179,180,0,8,4);

ellipse(308,179,180,0,8,4);

ellipse(230,220,0,360,30,30);

ellipse(370,220,0,360,30,30);

ellipse(250,330,0,360,30,30);

ellipse(350,330,0,360,30,30);

getch();

closegraph();

}



In the above code we used the simple ellipse and circle functions in order to draw teddy bear on your screen.setbkcolor function changes your background color to your desired color.setcolor changes the drawing color.You can study these functions in detail from our tutorial Graphics in C.Here is the output of the above code:



Output

c_graphics