Bungling hollow square loop

Hey. So I'm supposed to build a program that will allow me to create a hollow square up to 20 characters long and wide depending on how many you enter. My instructor also wanted us to create a sentinel that would end the program if you entered a number below 1 or above 20. Here is the code.

It builds the first and last character, but doesn't loop it all the way around. Plus, it's not returning so you can exit the program via enter key. Which is strange, because it first started doing that when I entered the while(true) loop with the if()break.