- Write a complete C++ program that does the following.
- It asks the user to enter a positive integer value, x, that is at most 100.
- The program reads a value entered by the user. If the value is not in the right range, the program should terminate.
- The program reads and stores x words from the user and then prints them in reverse order.
For example, the following represents one run of the program.
How many words? 5
Freddy and Max were absent
absent were Max and Freddy
- Write a complete C++ program that does the following.
- It asks the user to enter a positive integer value, r, that is at most 100.
- The program reads a value entered by the user. If the value is not in the right range, the program should terminate.
- The program reads and stores r integers from the user and then prints a pattern of r rows of stars, the lengths of which are the other integers entered by the user.
For example, the following represents one run of the program.
How many rows? 4
Enter 4 row lengths: 2 7 1 5
**
*******
*
*****
- Write a complete C++ program that does the following.
- It asks the user to enter a positive integer n that is at most 100.
- The program reads in an array of n integers entered by the user.
- The program prints the negative entries from the array, in order.
- The program prints the positive entries from the array in reverse order.
For example, the following represents one run of the program.
Enter a positive integer (at most 100): 8
Enter 8 integers: 3 -1 4 -10 17 18 19 -11
-1 -10 -11
19 18 17 4 3