It depends where the "void" is. If you are talking about the return type of the function you have to leave it there, or replace it with a type name if you want the function to return a value.
this is wat i already had
and my question was
Write your question here.
i cant seem to understand how to place number to plug in on their own and be able to use a number being plugged in(Output a list of all divisors of numbers that are not prime and a list of divisors of all perfect numbers. Format your output so there are between 5 and 10 numbers per line .) if you can just explain that would be great really having trouble.
the thing is im a beginner and i really cant use void because i have not learned it and i have to get numbers that are not prime and perfect numbers to appear.
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
//get their number
int main()
{
{
int perfectnumber;
int number;
char response, prime;
cout << "Not sure if its a prime number or perfect number." << endl;
cout << "Would you like to find out if your number is prime or perfect?" << endl;
cin >> response;
cout << "
if (response == 'Y' || response == 'y')
{
cout << "Please enter any number you would like to check" << endl;
cin >> number;
}
else if (response == 'n' || response == 'N')
{
cout << "thanks come try me again soon!" << endl;
system("pause");
return 0;
}
else if (response != 'y' || response != 'Y' || response != 'N' || response != 'n' )
{
cout << "wrong input try again" << endl;
system ("pause");
}
//prime
if ((number / 1 == number) && (number / number == 1))
{
cout << "It is a prime number!" << endl;
}
else if ((number % 2 == 0 || number % 3 == 0 || number % 4 == 0 || number % 5 == 0 || number % 6 == 0 || number % 7 == 0 || number % 8 == 0 || number % 9 == 0))
{
cout << "Not a prime :(" << endl;
}
//perfect number
{
int i=1,sum=0;
while(i<number){
if(number%i==0)
sum=sum+i;
i++;
}
if(sum==number)
cout << i << " is a perfect number!";
else
cout << i << " is not a perfect number :(";
system("pause");
return 0;
}
}
}