Implement Moving Car in Graphics
Write a C program to implement Moving Car in Graphics. Here’s simple C program to implement Moving Car in Graphics in C Programming Language.
Below is the source code for C program to implement Moving Car in Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C program to implement Moving Car in Graphics */ #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<dos.h> #include<graphics.h> void main() { int gd=DETECT,gm; int i=0,m=0; initgraph(&gd,&gm,"..\\bgi"); while(!kbhit()) { cleardevice(); i++; if(i>getmaxx()) i-=670; line(80+i,300,90+i,270); line(90+i,270,120+i,270); line(120+i,270,160+i,240); line(160+i,240,230+i,240); line(230+i,240,275+i,270); line(275+i,270,310+i,270); line(310+i,270,335+i,290); line(335+i,290,335+i,300); line(255+i,300,335+i,300); line(180+i,300,210+i,300); line(80+i,300,135+i,300); arc(232+i,300,0,180,23); arc(157+i,300,0,180,23); circle(232+i,300,18); circle(157+i,300,18); pieslice(232+i,300,0+m,90+m,18); pieslice(232+i,300,180+m,270+m,18); pieslice(157+i,300,0+m,90+m,18); pieslice(157+i,300,180+m,270+m,18); if(m<-360) m=90; m-=3; delay(5); } getch(); closegraph(); }
Above is the source code for C program to implement Moving Cars in Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .
If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.
Thanks for reading the post….