I think I got it...(Print a box using ASCII characters)
But I wish to simplify it... any suggestions dudes ???
----------------------------------------------------
#include <stdio.h>
#define UL 213 /*upper left*/
#define LL 212 /*lower left*/
#define UR 184 /*upper right*/
#define LR 190 /*lower right*/
#define HZ 205 /*horizontal line*/
#define VR 179 /*vertical line*/
main()
{
int x1, y1, x2, y2, i;
clrscr();
printf("Please define the proper coordinates of a 2-Dimensional window.\n");
printf("\n\nFor the UPPER LEFT coordinates.\n");
printf("\nInput the 1st x-coordinate(x1): ");
scanf("%i", &x1);
printf("\nInput the 1st y-coordinate(y1): ");
scanf("%i", &y1);
printf("\n\nFor the LOWER RIGHT coordinates.\n");
printf("\nInput the 2nd x-coordinate(x2): ");
scanf("%i", &x2);
printf("\nInput the 2nd y-coordinate(y2): ");
scanf("%i", &y2);
clrscr();
gotoxy(x1, y1);
printf("%c", UL);
gotoxy(x2, y2);
printf("%c", LR);
gotoxy(x1, y2);
printf("%c", LL);
gotoxy(x2, y1);
printf("%c", UR);
for(i=1; i<y2-y1; i++)
{
gotoxy(x1, y1+i);
printf("%c", VR);
}
for(i=1; i<y2-y1; i++)
{
gotoxy(x2, y1+i);
printf("%c", VR);
}
for(i=1; i<x2-x1; i++)
{
gotoxy(x1+i, y1);
printf("%c", HZ);
}
for(i=1; i<x2-x1; i++)
{
gotoxy(x1+i, y2);
printf("%c", HZ);
}
getch();
}
=====================
Thanks !!