Untitled
unknown
plain_text
2 years ago
539 B
10
Indexable
#include <stdio.h>
int hollowsquare(int);
int main(){
int n;
printf("Enter the length of the square in units ");
scanf("%d", &n);
hollowsquare(n);
return 0;
}
int hollowsquare(int n){
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (i == 0 || i == 3 || j == 0 || j == 3){
printf("%c ", 'A');
}
else{
printf(" ");
}
}
printf("\n");
}
return 0;
}Editor is loading...