Question: Objectives: Learn how to use the C++ while and for loops. Instructions: A perfect number is a positive integer greater than 1 that is equal
Objectives: Learn how to use the C++ while and for loops. Instructions: A perfect number is a positive integer greater than 1 that is equal to the sum of the positive integer numbers, including 1 but not including itself, that evenly divide into it. First, you should prompt the user for a number. Next, you should indicate if the number is a perfect number or not. Finally, you should list the numbers that evenly divide into the number entered and the sum of these numbers as an equation. Afterwards, start the process again by prompting the user for another number. You should stop the execution when the user enters a number that is not greater than 1. You are required to use at least one while loop and at least one for loop. Below are examples of perfect and imperfect numbers.
6 is a perfect number: 1+2+3=6
10 is not a perfect number: 1+2+5=10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
