29 Aug 2013

Write a 'C' program to animate a circle?

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

How to Create WEBSITE DESIGN

Way2finder Technologies is a web design studio that offers corporate web design and custom web design. Our website designers offer cheap w...