Create a ice-cream



We are here again with a amazing tip of c-graphics.This will tell you how can you create a ice-cream by using simple c-graphics functions.To learn to draw a ice-cream 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);

setlinestyle(0,0,3);

setcolor(LIGHTRED);

line(250,250,340,250);

line(250,250,210,150);

line(340,250,380,150);

line(210,150,380,150);

line(260,250,220,149);

line(270,250,230,149);

line(280,250,240,149);

line(290,250,250,149);

line(300,250,260,149);

line(310,250,270,149);

line(320,250,280,149);

line(330,250,290,149);

line(340,250,300,149);

line(345,233,310,149);

line(350,220,320,149);

line(355,210,330,149);

line(360,200,340,149);

line(365,190,350,149);

line(370,180,360,149);

line(330,250,370,150);

line(320,250,360,150);

line(310,250,350,150);

line(300,250,340,150);

line(290,250,330,150);

line(280,250,320,150);

line(270,250,310,150);

line(260,250,300,150);

line(250,250,290,150);

line(245,240,280,150);

line(240,228,270,150);

line(235,217,260,150);

line(230,206,250,150);

line(225,195,240,150);

line(220,184,230,150);

ellipse(295,150,0,180,85,70);

settextstyle(4,HORIZ_DIR,2);

circle(295,65,15);

setfillstyle(SOLID_FILL,LIGHTRED);

floodfill(295,65,LIGHTRED);

setcolor(LIGHTRED);

outtextxy(235,105,"ICE CREAM");

getch();

closegraph();

}



In the above code we used the simple circle and line functions in order to draw ice-cream on your screen.setbkcolor function changes your background color to your desired color.setcolor changes the drawing color.setlinestyle function is used to set the style of line.floodfill and setfillstyle functions are used to fill the color and set the fill color style.You can study these functions in detail from our tutorial Graphics in C.Here is the output of the above code:



Output

c_graphics