+ 1
IF() have only variable???
In c++ when if() statement with variable only (without any comparison to anything else) is implemented what does that check for eg: if(a) cout<<"LIKE IT"; now What is the condition on which if statement will run...
5 ответов
+ 6
the statement in brackets must return true or false (boolean)(true = execute, false = don't) that's why we put conditions there ((1 + 1 == 2) == true)
if "a" is true or different than 0
it'll execute else it won't...
+ 4
I think so...
+ 3
good question
0 is equal to false
1 is equal to true
+ 2
in some languages everything higher than 0 is true
+ 2
it works for negative values too (-4,-1....)
means it returns false for 0 only...???
m i right???