You have made a lot of syntactical mistakes here.
if (number % i == 0)
return false;
else
return true;
if (false);
Do you really think the control will ever reach the line "if (false)" ? Also let's for a moment assume it does, will the control ever enter the statement in the if block ? What do you think are you doing evaluating if (false) ?
Not to mention the complete waste of code there.
Simply writing
return (number % i == 0);
would work just as well :)
jwenting
duckman
8,558 posts since Nov 2004
Reputation Points: 1,674
Solved Threads: 347
Skill Endorsements: 19