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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started