Question: Write a program that asks the user to enter an integer between - 5 0 and + 5 0 , inclusive. Your program must check

Write a program that asks the user to enter an integer between -50 and +50, inclusive. Your program must check that the entered value is within this range and repeatedly ask the user to enter an integer in the range if it is not. For positive numbers, print a pattern that has 1 on the first line, 22 on the second line, 333 on the third line, and so on, up to the value of the number entered. For negative numbers, print the pattern in the opposite direction, that is, with the largest number printed first down to 1. Repeat this process until the user enters 0.

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!