Question: Write a C++ program that prompts for and reads any number of positive integers and displays the number of the positive integers entered that are

Write a C++ program that prompts for and reads any number of positive integers and displays the number of the positive integers entered that are multiples of seven. Assume that input of the positive integers ends when the user enters a negative integer.

Hint: If an integer is a multiple of seven, what is the remainder when it is divided by seven?

Here is an output example from running the program (user input is in bold):

Enter a positive integer (negative to stop): 13

Enter a positive integer (negative to stop): 35

Enter a positive integer (negative to stop): 17

Enter a positive integer (negative to stop): 9

Enter a positive integer (negative to stop): 55

Enter a positive integer (negative to stop): 28

Enter a positive integer (negative to stop): -1

Number of seven multiples entered = 2

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!