i have seen at many places where condition is to be evaluated.. if(a) {} if(!a) {} for(i=0;!a;i++) {} if(1){} if(!9){} and things lyk that can u tell me wat r the various types of conditions of if() n wat datatypes should be "a" for the above cases...??? and i knw the basic functionality of if()..!!!
Moved thread to C Programming and each of those if statements means checking if the condition is true or false. Integer is 0 is equivalent to false.
Hello IndiraP Suppose I have the following Code: int a=5 if(a) ... What would such absurd looking loc(lines of code) mean?Well if you look at it closely it means "If the a has a definite value(any value other than zero) then the condition is true else the condition is false".Even a negative value or a floating point value is taken as truth value.