Question: 1 . Write a C + + program that does the following: a . Create a C + + file with the name problem 2

1. Write a C++ program that does the following:
a. Create a C++ file with the name problem2.cpp.
b. Prompt the user for an odd positive integer n, terminating the program if the user enters an invalid integer.
c. Print an n x n grid displaying a large letter X with the following properties:
a. The left half of the X using the character +
b. The right half of the X using the character x
c. The middle line using the character *
Sample run of the program:
Enter an odd positive integer for n: 7
+x
+x
+ x
*
+ x
+x
+x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!