Question: I want answer Write a C++ program that uses nested for-loops to display a square of characters (see examples below). The program should ask the
Write a C++ program that uses nested for-loops to display a square of characters (see examples below). The program should ask the user to enter an integer n representing the number of rows/columns in a square. The number n should be odd and not less than 3. If the number is not valid, then display an appropriate message and exit the program. If the number n is valid then the program must print the square. The square shape will be displayed using hashes (#) and dots.) alternating similar to the examples below. Examples one2 then print Un=3 then print im-5 then print Invalid number #.# .#.#. #.# #.#.# #.#. #.#.# #.#.# .#
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
