Question

# Find the five problems in this program. There are both syntax and logical issues. Do not rewrite it, just fix

it.

#include <iostream>

using namespace std;

bool is_prime(int value)

*// This program prints out the first 10 odd primes (3, 5, 7, ...)*

int main()

{

int value = 3;

int counter;

while( counter < 10 );

{

if ( is_prime(value) )

{

cout << counter << " " << value << endl;

counter++;

}

value +=2;

}

return 0;

}

bool is_prime(int value)

{

for(int i = 3; i < value / 2; i+=2);

if ( value % i == 0 )

return true;

return false;

}

#### Top Answer

Below is the fixed code: #include <iostream> using namespace std ; bool is_prime ( int value ) ; // This program prints... View the full answer