Question: Write a program that REPEATLY asks the user to input a positive integer n until they provide a valid input ( a positive integer )

Write a program that REPEATLY asks the user to input a positive integer n until they provide a valid input (a positive integer). Once a valid number is entered, the program should print all the numbers from 1 to n, but with the following conditions:
If a number is divisible by 3, skip printing that number using continue.
If a number is greater than 15, stop printing entirely using break.

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!