Expression statements

An expression statement contains an expression. The expression can be null.

Read syntax diagramSkip visual syntax diagramExpression statement syntax
 
>>-+------------+--;-------------------------------------------><
   '-expression-'
 

An expression statement evaluates expression, then discards the value of the expression. An expression statement without an expression is a null statement.

The following are examples of statements:

printf("Account Number: \n");          /* call to the printf    */
marks = dollars * exch_rate;                /* assignment to marks     */
(difference < 0) ? ++losses : ++gain;  /* conditional increment */

Related information