+ 1
How to draw squares inside squares using for loops?
Hi guys, so we were given this practice task in which we have to get the size of outer square from user and then we have to ask the number of inner squares they want to be printed inside (this is to be done using for loop only) I have managed to make the outer square but when I try to draw outer square + inner squares,for some reason it starts drawing some weird shapes :( I've tried a lot for a couple of hours but couldn't figure anything out. So, if anyone could help me, it would be much appreciated. thanks.
11 Respuestas
+ 1
「HAPPY TO HELP」 sorry I forgot to mention, it's in C++
+ 1
「HAPPY TO HELP」 that would be soooo helpful 😍 thanks a ton!
0
「HAPPY TO HELP」 yep got it to some point but still confused about the placement of loop for the inner square. should it be in the mid? like after the line for boundary line?
0
「HAPPY TO HELP」 both are same. for example if the size is 17 then the height is 17 and the width is also 17
0
sure
0
actually all we were told was that each inner square will be after an interval of 2 empty spaces. forgot to mention again :/ really sorry! and we also have to figure out if the number of inner squares that user has entered is possible or not which I was able to do.
0
+__+ like this. "_" represents a space actually there will be nothing in this area just a space
0
it's 1 XD
0
hahahaha 😂 true that! I spent about 6-7 hours trying to do it! i know I'll figure it out but it's hard XD now it's 4 AM here n I'm done with this XD
0
haha sure! will check later in the morning XD
0
hahaha it's alright! it works :D