Trying to use an array and find perfect numbers in it. I have code I wrote using input value but I have no idea where to start to use an array. Array should be 8000 in size, I will update as I go along as well. Any tips would be amazing
#include <iostream>
#include <cmath>
usingnamespace std;
void showPerfect(int, int, int);
void isPerfect(int);
int main ()
{
int num;
cout << "Enter a number to find if it is perfect!";
cin >> num;
isPerfect(num);
return 0;
}
void isPerfect(int value1)
{
int sum=0, i;
for (i=1; i<=(value1/2);i++)
{
if(value1 % i==0)
{
sum = sum + i;
}
}
showPerfect(sum, i, value1);
}
void showPerfect(int num1, int num2, int num3)
{
if (num1 == num3)
{
cout << num1 << " Is perfect";
}
else
{
cout << num1 << " Is not perfect";
}
}