Question: Question 2 ( 14 marks ) Write a C++ program that uses nested for-loops to display a sequence of numbers. The program should ask the

 Question 2 ( 14 marks ) Write a C++ program that

Question 2 ( 14 marks ) Write a C++ program that uses nested for-loops to display a sequence of numbers. The program should ask the user to enter an integer n. The number n should be between 3 and 1000. If the number is not in the range, then display an appropriate message and exit the program. On the first line, the program should display the number n repeated n times. Then on the next line it should display the number n-1 repeated n-1 times, and on the next line it should display the number n-2 repeated n-2 times, and so on for the next lines and only stop when the number reaches zero. Display a star (*) before each line and display a hash (#) at the end of each line. See examples below: Examples if n=2 if n=3 if n=6 *333# *666666# Invalid number *22# *55555# *1# *4444# *333# *22# *1#

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 Databases Questions!