You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
{
int x,y,x1,y1,tx,ty,tx1,ty1;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
printf("enter the x,y,x1,y1 coordinate\n");
scanf("%d%d%d%d",&x,&y,&x1,&y1);
printf("Enter the translation coordinate\n");
scanf("%d%d",&tx,&ty);
line(x,y,x1,y1);
line(x+tx,y+ty,x1+tx,y1+ty);
getch();
}

You might also like