Hello,
Using ASCII and C programming I am creating a program whose output is a box within a box. I am very close to completion but I am stuck on one part and need your help.
Here is the code:
Code:
#include <stdio.h>
int main()
{
int k;
char UpperLeft,UpperRight,LowerLeft,LowerRight,Vertical,Horizontal;
UpperLeft = 218;
UpperRight = 191;
LowerLeft = 192;
LowerRight = 217;
Vertical = 179;
Horizontal = 196;
printf("\n\n\n\n\n\n\n\n\n\n\t ");
for ( k = 0; k < 40; k++)
{ printf("%c",Horizontal);
printf("%c",UpperRight);
}
for ( k = 0; k < 3; k++)
{ printf("\n\t\t %c",Vertical);
printf("\t\t\t\t %c",Vertical); }
printf("\n\t\t ");
printf("%c",UpperLeft);
for ( k = 0; k < 36; k++)
{ printf("%c",Horizontal); }
printf("%c",UpperRight);
for ( k = 0; k < 10; k++)
{ printf("\n\t\t %c",Vertical);
printf("\t\t\t\t %c",Vertical); }
printf("\n ");
printf("%c", LowerLeft);
for ( k = 0; k < 36; k++)
{ printf("%c",Horizontal); }
printf("%c", LowerRight);
printf("\n\n\n\n\n\n\n");
Which gives me:
As I increase the size of the outer box, the lower one keeps sliding down lines becuase the \n is included with the "for loop". Is there a way to prevent this so I can increase the outer without affecting the inner box? Thanks.