I'm new user C++,I have to write a program that will
compute and list all the perfect number from 1 to 1000.
[Hint: the solution will require a nested loop]
so I'm trying to do it but I got stuck about the formula of the perfect number. Can some one please help me. Thank you all!!!
the following is the code I have so far
#include <iostream>
using namespace std;
int main()
{
//i is number of rows and j is number of columns
for (int i = 1; i <= 1000; i++)
{
i = [2^(iā1)](2^i ā 1)
}
An integer is said to be a perfect number if the sum of its divisors, including 1 (but not the number itself!), is
equal to the number. For example, 6 is a perfect number because 6 = 1 + 2 + 3.