```
//3. Write a program to Implement Translation?
//Translation
#include
#include
#include
#include
#include
int x1,y1,x2,y2,x,y;
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
cout<<"enter the values of line coordinates:";
cin>>x1>>y1>>x2>>y2;
cout<<"enter the translation coordinates:";
cin>>x>>y;
cleardevice();
line(x1,y1,x2,y2);
cout<<"now hit a key to see translation:";
line(x1+x,y1+y,x2+x,y2+y);
getch();
closegraph();
}
```
</div>
Leave a comment