Since num1 and num2 are integers, I suspect the output of num1 / num2 is being cast as an integer, which is giving you a bunch of wrong outputs, since any output that equals 5 to 5.99999999 will be converted to 5, and equate to true, in if (num1 / num2 == 5). Try casting the output as double, that way only the outputs that equal 5.0, will equate to true.
tinstaafl
Nearly a Posting Virtuoso
1,476 posts since Jun 2010
Reputation Points: 429
Solved Threads: 261
Skill Endorsements: 14
Good, please mark it as solved. thank you.
tinstaafl
Nearly a Posting Virtuoso
1,476 posts since Jun 2010
Reputation Points: 429
Solved Threads: 261
Skill Endorsements: 14