I need to write a C program that prints a rectangle to the screen with a blank space in the four corners. All I can do is a rough idea of how the program will look like with only the top and left part of the rectangle, but I have no idea how to print the words the second time at the correct location..
#include <stdio.h>
#include <string.h>
int main (void)
{
char length[70];
char width[70];
int i, j;
for (i = 0; i < 70; i++) {
length[i] = i;
printf("Enter word to use for length: ");
scanf("%s", length);
printf("%c", length[i]);
}
for (j = 0; j < 70; j++) {
width[j] = j;
printf("Enter word to use for width: ");
scanf("%s", width);
printf("%c\n", width[j]);
}
return 0;
}
The output of the program should look like this:
Enter word to use for length: length
Enter word to use for width: width
length
w w
i i
d d
t t
h h
length
EDIT: there should be spaces in between the two vertical "width"s to form a rectangle