Car

Description:           This program creates graphic for moving car.

Primary Inputs:    ——-
Primary Output:    moving car
Platform Used:      Turbo C++ version 3.0, Borland International Inc.
 

#include
#include
#include
#include
void main()
{
int gdriver = DETECT;
int gmode;
int i;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi");
line(0,400,640,400);
for(i=0;i<300;i++) { line(0, 400, 640, 400); rectangle(300-i, 240, 440-i, 300); rectangle(250-i, 300, 490-i, 360); line(300-i, 240, 250-i, 300); line(440-i, 240, 490-i, 300); line(340-i, 240, 340-i, 300); circle(330-i, 290, 10); circle(280-i, 380, 20); circle(460-i, 380, 20); delay(25); clrscr(); } getch(); }

 

1/5 - (1 vote)

Leave a Reply