Download CS240 Programming in C
Transcript
if Statement
if(..expression..){
.....
.....
}
Expression in if (exp) statement is converted to int.
If (expression) != 0 then expression is true and the body of the statement is
executed.
if(expression) == 0 then it is false and the body is not executed. Then
continues to check against else if or else statements are used to then be
executed.
Example:
int i;
if(i != 0){
// do something
}
equivalent to:
if(i){
// do something
}
Related documents