C Graphics Program For Square Animation

#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
void main()
{
int d=2,k=0;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\tc\bgi");
setcolor(2);
outtextxy(300,430,"Press any key to continue....");
setcolor(5);
setwritemode(1);
rectangle(180,120,380,320);
getch();
clearviewport();
while(!kbhit())
{
   d%=91;
   setcolor(k);
   rectangle(180+d,120+d,380-d,320-d);
   delay(40);
   d+=2;
    k++;
   }
   getch();
   }


Share:

Total Pageviews

CONTACT US

Prof. Roshan P. Helonde
Mobile: +917276355704
WhatsApp: +917276355704
Email: roshanphelonde@rediffmail.com

Enter Project Title

Popular Projects

All Archive

Contact Form

Name

Email *

Message *