-->
Saturday, July 16, 2022
Simple Truck Drawing | C Graphics Program
FindError
Home
Catagories
C Programs
C Graphics
Python Programs
About
Contact
Home
About
Contact
C Graphics Programs
Design a Home
Design a Home with color
Design a Tree
Design a Car
Draw a Truck
Draw Rabindranath Tagore
Mom and Baby Elephant
Simple Truck Drawing using C Graphics
Q. Write a program to draw a truck using C graphics
Output
Source Code
// WAP to draw a truck using C graphics // Code for TurboC++ compiler #include
#include
void truck(){ //front part line(108,183,108,208); line(108,183,140,177); line(140,194,140,177); line(140,177,141,163); line(141,163,167,163); arc(167,163,90,180,26); rectangle(167,137,197,196); rectangle(197,169,200,191); line(108,195,114,192); line(114,192,140,192); line(140,194,142,196); line(108,208,110,208); line(110,208,110,200); line(110,200,114,195); line(114,195,131,195); line(131,195,142,208); rectangle(142,196,206,208); rectangle(143,203,206,205); line(206,208,230,208); line(206,201,229,201); line(223,208,233,198); line(233,198,278,198); line(278,198,288,208); line(252,208,258,208); line(280,208,288,208); //doors, windows and other things rectangle(146,166,161,192); rectangle(145,166,148,176); rectangle(149,168,159,176); rectangle(172,166,185,178); rectangle(172,181,185,191); rectangle(195,131,198,193); //back rectangle(213,130,219,161); rectangle(219,126,497,196); line(219,192,497,192); line(395,196,395,203); line(395,203,417,203); line(435,203,446,203); line(464,203,492,203); line(492,203,492,197); //design line(497,127,413,192); line(220,192,291,127); //Wheels circle(124,212,12); circle(124,212,4); circle(241,212,12); circle(241,212,4); circle(269,212,12); circle(269,212,4); circle(426,212,12); circle(426,212,4); circle(455,212,12); circle(455,212,4); //colors floodfill(156,204,15); floodfill(197,133,15); floodfill(125,213,15); floodfill(244,213,15); floodfill(272,213,15); floodfill(428,212,15); floodfill(457,212,15); floodfill(479,178,15); floodfill(226,155,15); } void main(){ int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\Turboc3\\BGI"); truck(); getch(); closegraph(); }
Copy Code
C Graphics Programs
Design a Home
Design a Home with color
Design a Tree
Design a Car
Draw a Truck
Draw Rabindranath Tagore
Mom and Baby Elephant
No comments:
Post a Comment
Newer Post
Older Post
Home
Contact Form
Name
Email
*
Message
*
No comments:
Post a Comment