What would be the value of this expression !(13%7 == 24%9)?
What would be the value of this expression !(13%7 == 24%9)?
Why not test it and see? "really quickly". Either that, or do simple maths and simple logic.
!6 == 6) evaluates to !TRUE or FALSE.
With all the things to learn in programming, why is this kind of trivia seen as important, though?
Not always needed, but logical expressions like this should be grouped by their own parenthesis:
!((13%7) == (24%9))
Last edited by Adak; 02-11-2010 at 06:37 AM.
5 seconds to try.
30 minutes for a forum reply (ohh, poetry)
Go figure....
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I am going to guess he could not test it because this person was IN a test and didn't have access to the computer, but did have access to his iPhone/Blackberry/other handheld. Hence the "really quick" subject. If that's the case I hope the cheater failed.
Wouldn't they say phones... are not allowed during a test?
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
Sweet, zacs! Good to know, but I bet that's a rare occurrence. I know I've seen questions here and elsewhere before where someone was in some sort of timed test looking for a quick answer...this one struck me as that sort of situation.
BBC News - Hi-tech exam cheating increases says Ofqual
Notice the bluster over the 0.03% detection rate.
I wonder what that actual undetected cheating rate is.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.