1 2 3
|
if (st%i==0)
cout << i<<endl;
return false;
|
is not the same as:
1 2 3 4 5
|
if (st%i==0)
{
cout << i<<endl;
return false;
}
|
it is interpreted as:
1 2 3 4 5 6
|
if (st%i==0)
{
cout << i<<endl;
}
return false;
|
So even if
st%i==0
is true, it will still return false;
Last edited on
You haven't closed all your braces. You added an extra open-brace around the code in your "if" block, but not a close-brace.
You're missing the closing brace in you Prime function.