Today in this tutorial I am going to show you how to print a figure of a man in c++.
The main theme is to learn the Graphics header in the c++ for the budding programmers out there which will help them understanding the viability of the graphics file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #include "graphics.h" #include "iostream.h" #include "stdlib.h" #include "stdio.h" #include "conio.h" void main() { int gdriver=DETECT,gmode; initgraph(&gdriver, &gmode, “c:\turboc3\bgi”); //for head ellipse(320,95,360,0,25,20); line(298,85,341,85); circle(310,90,2); circle(330,90,2); arc(320,100,200,-20,10); //for neck line(313,115,313,125); line(328,115,328,125); //For centre part arc(320,225,72,107,100); line(290,129,290,200); line(350,129,350,200); line(290,193,350,193); line(290,200,350,200); //for legs line(290,200,285,280); line(320,225,305,280); line(322,225,335,280); line(350,200,355,280); //for right hand line(290,129,255,165); line(255,165,290,200); line(290,149,275,165); line(275,165,290,182); //for left hand line(350,129,385,165); line(385,165,350,200); line(350,149,365,165); line(365,165,350,182); //for shoes line(285,280,275,287); line(275,287,305,287); line(305,280,305,287); line(335,280,335,287); line(335,287,365,287); line(355,280,365,287); //for name settextstyle(2,HORIZ_DIR,4); outtextxy(293,150,”The”); outtextxy(292,160,”Coding Security”); getch(); closegraph(); } |