Question: Why are you asking the user to input a character?
You only need a number, and the number represents the dimensions of the square or the triangle. You draw either a square or a rectangle depending on whether the number is even or odd.
So let's do that first. Try to see if you can draw a square and a rectangle using while. ^_^
And then we need to identify what part of the while we can change so that the dimensions change according to the number we input.
You already know how to check whether the number is even ;)