1. ## emirps program help

i'm working on a program that is supposed to display the first 100 emirps. right now i have it so i have to put in an input.

i need the program to run itself with no input .. and it has to display all the emirps like 10 per line ..

here is my code right now .. it just diisplays if an inputted number is prime or not and it checks if its emirp is prime or not .. how can i adjust it to do what i mentioned above?

Code:
```#include <iostream>
using namespace std;

enum Logical {False, True};

int get_valid_number();
Logical prime(int integer);
int reverse_num(int sourcenum);

int main()
{
int number, sum, counter;

for (counter=1; counter<=600; counter++)
{

cout << "This will test to see if a number is prime...\n" << endl;

number = get_valid_number();
while (number != 0) {
cout << "\n\nThe number " << number << " is ";
if (!prime(number))
cout << "not ";
cout << "a prime number...\n\n";

sum = reverse_num(number);
cout << "Also the EMIRP, " << sum << " is ";
if (!prime(sum))
cout << "not ";
cout << "a prime number...\n\n";
number = get_valid_number();
}

return (0);
}

int get_valid_number()
{
int number;
do
{
cout << "\nEnter an integer...(0 to end): ";
cin >> number;
}
while (number < 0 || number > 10000);

return number;
}

Logical prime(int integer)
{
for (int factor = 2; factor<integer; factor++) {
if ((integer % factor) == 0)
return False;
}
return True;
}

int reverse_num(int sourcenum)
{
int temp = sourcenum;
int sum = 0;
while (temp)
{
sum*=10;
sum += temp%10;
temp/=10;
}
return sum;
}``` 2. can't you just loop through all integers from 0 to 2^32-1 and perform the same test? 3. Popular pages Recent additions 