Question: Write a program to display the following image. a. Request an integer from the console. b. If the integer is -1 then exit the
Write a program to display the following image. a. Request an integer from the console. b. If the integer is -1 then exit the program, otherwise stay in a loop asking for input c. If the integer is not odd repeat the request and wait for an odd number. d. If the integer is odd then output the image shown below using a nested loop. After you have output the image go back to the top and request another integer e. Your code must produce the same image (of varying size) for any odd numbers entered. Example Output Enter an odd integer or -1 to quit: 8 Must enter an odd integer, try again. Enter an odd integer or -1 to quit: 9 Enter an odd integer or -1 to quit: 5 Enter an odd integer or -1 to quit: -1 End of program.
Step by Step Solution
There are 3 Steps involved in it
Our experts were unable to provide an a... View full answer
Get step-by-step solutions from verified subject matter experts
