Converting an int main function to void()
I really do need help and am trying my hardest to learn. I hope I'm not annoying anyone too much here, anyways.....
I need to write a program that will be able to determine whether or not the function is a prime number, and if so or not, it will say, "XXX is / is not a prime number" I was able to get the program the exact way its supposed to run but he wants us to use int Prime (void).
My question is since i have the following program, how do I go about converting this program to use the void function.
Code:
#include <iostream>
using namespace std;
int number;
int main()
{
cout << "You have selected the prime option."
<< "\nEnter any number you wish to test.";
cin >> number;
if ((number % 2 ==0) || (number % 3 == 0) || (number % 5 == 0))
cout << "Not a prime number. ";
else if ((number % 2 !=0) || (number % 3 != 0) || (number % 5 != 0))
cout << " " <<number << " is a prime number. ";
return 0;
}
OK, there ya go, all help is welcome and I am at your mercy
-steve