Mark Space said:
It's false. I don't care about your answer key. Get a compiler and try
it, or better yet learn the language.
Your latest one here is wrong too, ints aren't even comparable to
booleans.:
[ SNIP ]
This question brings up the always popular programming trivia contest...what
are the truth values in various programming languages? Not always easy to
remember...
For example, in awk "0" is true because it's a non-null string value.
However, in Perl "0" is false (but "0.0" is true). Apparently in REBOL the
integer 0 is true.
Does the language in question (1) use two boolean values, or (2) does it
define truth values for all values of datatypes, or (3) does it define two
boolean values *and* also truth values for values of other datatypes?
Example of #3 being Javascript.
Then there's the convention in UNIX that a program is considered to have
succeeded if it sets an exit code of 0, which can catch the novice shell
script programmer by surprise...
I think there was an attempt to design a bool class in C++ quite some back
but they couldn't quite design one that was completely correct, hence the
bool datatype. Of course you can still initialize a bool with 0...
AHS