Source Code
#include<graphics.h>
#include<conio.h>
#include<dos.h>
int main()
{
int gd = DETECT ,gm,j=0,a,b,p,q,r,s;
initgraph(&gd,&gm,"c:/tc/bgi");
a = getmaxx()/2;
b = getmaxy()/2;
p = a-10;
q = b-10;
r = a+10;
s = b+10;
while(!kbhit())
{
setcolor(j);
rectangle(p,q,r,s);
p=p-10;
q=q-10;
r=r+10;
s=s+10;
j++;
delay(500);
}
getch();
closegraph();
return 0;
}
#include<conio.h>
#include<dos.h>
int main()
{
int gd = DETECT ,gm,j=0,a,b,p,q,r,s;
initgraph(&gd,&gm,"c:/tc/bgi");
a = getmaxx()/2;
b = getmaxy()/2;
p = a-10;
q = b-10;
r = a+10;
s = b+10;
while(!kbhit())
{
setcolor(j);
rectangle(p,q,r,s);
p=p-10;
q=q-10;
r=r+10;
s=s+10;
j++;
delay(500);
}
getch();
closegraph();
return 0;
}
0 comments:
Post a Comment