Program:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int a=DETECT,b;
int x1=90,y1=90,x2=200,y2=200,tx=200;
initgraph(&a,&b,"c://turboc3//bgi");
line(x1,y1,x2,y1);
line(x1,y1,x1,y2);
line(x2,y1,x2,y2);
line(x1,y2,x2,y2);
getch();
clearviewport();
line(x1+tx,y1,x2+tx,y1); //top
line(x1+tx,y1,x1,y2); //left
line(x2+tx,y1,x2,y2);
line(x1,y2,x2,y2);
getch();
}
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int a=DETECT,b;
int x1=90,y1=90,x2=200,y2=200,tx=200;
initgraph(&a,&b,"c://turboc3//bgi");
line(x1,y1,x2,y1);
line(x1,y1,x1,y2);
line(x2,y1,x2,y2);
line(x1,y2,x2,y2);
getch();
clearviewport();
line(x1+tx,y1,x2+tx,y1); //top
line(x1+tx,y1,x1,y2); //left
line(x2+tx,y1,x2,y2);
line(x1,y2,x2,y2);
getch();
}
Comments
Post a Comment
Thank you