program of movement of rectangle(translation)

//pramod singh bisht

#include<stdio.h>
#include<conio.h>
#include<graphics.h>

void main()
{

 int gd=DETECT,gm;
 initgraph(&gd,&gm,"c:\\tc\\bgi");
 setcolor(2);
 rectangle(20,20,50,50);
 while(!kbhit())
 {
 for(i=1;i<100,i=i+35)
 {
 setcolor(4);
 rectangle(x+i,y+i,a+i,b+i);
 delay(100);
 setcolor(6);
 rectangle(x+i,y+i,a+i,b+i);
 delay(100);






 }}

 getch();
 closegraph();
}

Comments

Popular posts from this blog

REFLECTION OF A TRIANGLE (COMPUTER GRAPHICS)