October 15th, 2010, 11:33 AM
That's because you have a spurious semi-colon at the end of the if statement line.
October 15th, 2010, 10:19 AM
Yep.
Personally I prefer the second approach as it guarantees the correct answer without any further processing but if your teacher has suggested using the modulus operator then use it.
As I...
October 15th, 2010, 08:44 AM
If you think about what you need to achieve there are several ways of doing this.
The modulus operator basically computes the remainder of a division operation, so the result of a modulus...
October 13th, 2010, 02:38 PM
I've already told you what you need to do.
for example
x = a * b;
if ( x > c )
x = c;
October 13th, 2010, 01:49 PM
Your calculation computes the number of lifeboats (9) times the number of people per boat (100) which equals 900 - where's the difficulty in working this out?
No, it's the other way around. The...