The program in ‘C’ Programming language to draw a circle on
the screen and animate it is as follows:
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
#define RADIUS 50
#define DELAY 20
void main()
{
            int x=0,
y=0, gdriver=DETECT, gmode=4;
            clrscr();
            initgraph(&gdriver,
&gmode, "C:\\TC\\BGI");
            while(!kbhit())
            {
                        for(x=0,
y=0; x<getmaxy() && !kbhit();)
                        {
                                    circle(x++,
y++, RADIUS);
                                    delay(DELAY);
                                    cleardevice();
                        }
                        cleardevice();
            }
            getch();
            closegraph();
 
 
No comments:
Post a Comment