Question: Need help c++ CSCI 2170 OLA2 Due: midnight March 3rd, Deadline: midnight March 5 In this open lab assignment, you will write two C++ programs
CSCI 2170 OLA2 Due: midnight March 3rd, Deadline: midnight March 5 In this open lab assignment, you will write two C++ programs for the following two problems. Problem 1: Write a C++ program, named perfect.cpp that displays all the perfect numbers that is between 0 and 10000 exclusive. A perfect number is such an integer: the sum of all its positive divisors (excludes the number itself) equals to the number itself. For example, number 6 is a perfect number. Its divisors are 1, 2, and 3. The sum of these divisors 1+2+3 equals to the number 6 itself. In the main function, one needs to write a while loop that loops through all the numbers from 1 to 9999. On each loop iteration, the program cheeks if that number is a perfect number. If it is perfect, display that number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
