FLIGHT
ANIMATION
AIM:
To
develop a c program to generate a flight animation
ALGORITHM:
·
Start
the program
·
Declare
the header files
·
Declare
the variables and detect the graphics function
·
Use
the suitable graphics function to draw a flight
·
Display
the result
·
Stop
the program
CODINGS:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void
main()
{
int gd=DETECT,gm,i,a=1;
initgraph(&gd,&gm," ");
for(i=1;!kbhit();i++)
{
setcolor(a);
line(375-i,350-i,530-i,350-i);
rectangle(380-i,350-i,390-i,360-i);
rectangle(390-i,350-i,400-i,360-i);
line(373-i,400-i,530-i,400-i);
rectangle(380-i,390-i,390-i,400-i);
rectangle(390-i,390-i,400-i,400-i);
rectangle(400-i,390-i,410-i,400-i);
line(530-i,350-i,560-i,385-i);
line(530-i,400-i,560-i,365-i);
line(430-i,350-i,500-i,280-i);
line(430-i,400-i,500-i,470-i);
line(373-i,400-i,530-i,400-i);
line(500-i,280-i,480-i,350-i);
line(500-i,470-i,480-i,400-i);
line(583-i,350-i,580-i,400-i);
arc(375-i,375-i,90,265,25);
line(580-i,350-i,560-i,365-i);
line(580-i,400-i,560-i,385-i);
delay(20);
cleardevice();
a++;
}
getch();
}
OUTPUT:
RESULT:
Thus, the program has been
successfully executed & output is verified.
No comments:
Post a Comment