Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
433 B
0
Indexable
Never
#include<stdio.h>
#include<graphics.h>
#include<stdlib.h>
#include<math.h>
int gd=DETECT,gm;
void main()
{
	int x1,y1,x2,y2;
	printf("Enter the co-ordinate x1 and y1:");
	scanf("%d%d",&x1,&y1);
	printf("Enter the co-ordinate x2 and y2:");
	scanf("%d%d",&x2,&y2);
	initgraph(&gd,&gm,NULL);
	line(0,100,200,100);
	setcolor(4);
	rectangle(x1,y1-100,x2,y2-100);
	
	setcolor(6);
	rectangle(x1,y1+100,x2,y2+100);
	getch();
	closegraph();
}
Leave a Comment