top of page
06 Control Structures
if (conditional)
if(expression){
// statement(s)
}
expression: a (boolean) C statement that evaluates to true or false
if, which is used in conjunction with a comparison operator, tests whether a certain condition has been reached, such as an input being above a certain number. The format for an if test is:
The curly braces may be omitted after an if statement. If this is done, the next line (defined by the semicolon) becomes the only conditional statement.
bottom of page