#include <iostream>
// note the use of function prototypes
bool isDivisible (int number, int divisor);
bool isPrime (int number);
usingnamespace std;
int main ()
{
for ( int i = 0; i < 100; i++ )
{
if ( isPrime( i ) )
{
cout << i << endl;
}
}
}
bool isPrime (int number)
{
for ( int i = 2; i < number; i++)
{
if ( isDivisible( number, i ) )
{
returnfalse;
}
}
returntrue;
}
bool isDivisible (int number, int divisor)
{
return number % divisor == 0;
}
I'm not sure why the author is doing a for loop from i = 2 to i < number and I'm not sure what the isDivisible function does exactly.