Question: Goal: Learn to write simple loops. Assignment: Write a code snippet that reads an integer value from standard input and stores it in a variable

Goal: Learn to write simple loops.
Assignment: Write a code snippet that reads an integer value from standard input and stores it in a variable n. Then, write a while loop that prints to the screen all the numbers from 2 to n that are multiples of 7. If, for example, the user inputs the value 29 for n, your program should produce the following output (user input in bold):
Insert an integer value: 29
7 is a multiple of 7
14 is a multiple of 7
21 is a multiple of 7
28 is a multiple of 7

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!

Q:

\f