Q:

Write a C Program to implement Kite flying in Graphics

0

Write a C Program to implement Kite flying in Graphics. Here’s simple Program to implement Kite flying in Graphics in C Programming Language.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Below is the source code for C Program to implement Kite flying in Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :

 
 


SOURCE CODE : :

/*  C Program to implement Kite flying in Graphics  */

#include<stdio.h>
#include<time.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
 
void main()
{
        int gd=DETECT,gm;
        int x=10,y=480;
        initgraph(&gd,&gm,"..\\bgi");
        while(!kbhit())
        {
                cleardevice();
                if(y==0)
                {
                        y=random(480);
                        x=random(640);
                }
                else
                {
                        y=y-1;
                        x=x+1;
                        line(x-50,y,x,y-70);
                        line(x,y-70,x+50,y);
                        line(x+50,y,x,y+70);
                        line(x,y+70,x-50,y);
                        line(x,y-70,x,y+70);
                        line(x,y+70,x+10,y+140);
                        line(x,y+70,x-10,y+140);
                        line(x-50,y,x+50,y);
                        line(x,y,x+130,y+640);
                }
                delay(20);
        }
        closegraph();
        restorecrtmode();
}

Above is the source code for C Program to implement Kitee flying in Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Graphic Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C graphics program for analog clock in Gra... >>
<< Write a C program to implement Bar Graph in Graphi...