Question: Question Goal: Conditionally assign a value to a variable Assignment: Write a complete program that reads from an integer from the keyboard, and then prints

Question
Goal: Conditionally assign a value to a variable
Assignment: Write a complete program that reads from an integer from the keyboard, and then prints all the numbers between 2 and 7(both
included) that are divisors of the input number, one per line.
In the following sample run, the user inputs the value 6, then the program displays the numbers 2,3, and 6 because those values are divisors of 6.
Sample Run with Input Shown in
Enter a number: 6>
2
3
6
In the following sample run, the user input the value 15, then the program displays the numbers 3 and 5 because those values are divisors of 15.
Sample Run with Input Shown in
Enter a number: 15>
3
5
Question Goal: Conditionally assign a value to a

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!