| C Tutorial | If statement | |||
|
If Statement Ternary Operator Switch Statement While Loop Do-While Loop For Loop Break Continue
|
Both an if and an if-else are available in C. The <expression> can be any valid expression. The parentheses around the expression are required, even if it is just a single variable.
if (<expression>) <statement> // simple form with no {}'s or else clause
if (<expression>) { // simple form with {}'s to group statements <statement> <statement> }
if (<expression>) { // full then/else form <statement> } else { <statement> }
Want To Know more with Video ???
|
|