fill the frame with the square

this program takes 2 numbers and creates a square let's say n=6 m=2
it creates this n is the size of the square and m is the thickness of the square and not the blank in the middle

******
******
** **
** **
******
******
now my problem is that I need to fill a frame of 23 rows and 79 columns with the square and I have no idea how (can't use loop)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
void main() {
	int i,n,rows,m,show,full_rows;
	do {
		printf("please enter frame size and width<frame size > 2*width>:");
	    scanf("%d",&n);
		scanf("%d",&m);
	}
		while (n<2*m);
	for (i=0;i<n;i++) {
		for (rows=0;rows<n;rows++){
			show=m>rows;
			show=show||m+rows>=n;
			if(show)
			    printf("*");
			else {
				full_rows=m>i;
				full_rows=full_rows||m+i>=n;
			         if (show==0&&full_rows)
				printf("*");
			         else
				printf(" ");
			}
		}
		if(rows==n)
			printf("\n");
	}
}
What do you mean you can't use loops? I guess you could use recursion, but I don't think that's a good way to use it..

no its our first job we cant use recursion and we cant use any more loop
but a hint that was given to us is that we should expand\change the for loop and use the moudole operator
Topic archived. No new replies allowed.