Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
514 B
1
Indexable
Never
#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
int gd=DETECT,gm;
void main()
{
	initgraph(&gd,&gm,"");
	int tx,ty,x1,y1,x2,y2,x11,y11,x12,y12=0;
	printf("Enter the translation values:");
	scanf("%d",&tx);
	scanf("%d",&ty);
	printf("Enter the coordinates:");
	scanf("%d",&x1);
	scanf("%d",&x2);
	scanf("%d",&y1);
	scanf("%d",&y2);
	setcolor(4);
	rectangle(x1,y1,x2,y2);
	x11=x1+tx;
	y11=y1+ty;
	x12=x2+tx;
	y12=y2+ty;
	setcolor(6);
	rectangle(x11,y11,x12,y12);
	getch();
	closegraph();
}