Statements must be separated by semicolon or newline. Except where altered by control statements, execution is sequential.
When a statement is an expression, unless the main operator is an assignment, the value of the expression is printed, followed by a newline character.
Statements may be grouped together and used when one statement is expected by surrounding them with { }.
"any string"
This statement prints the string inside the quotes.
The substatement is executed if the relation is true.
The statement is executed while the relation is true. The test occurs before each execution of the statement.
The for statement is the same as
first-expression
while(relation) {
statement
last-expression
}
All three expressions must be present.
break causes termination of a for or while statement.
The auto statement causes the values of the identifiers to be pushed down. The identifiers can be ordinary identifiers or array identifiers. Array identifiers are specified by following the array name by empty square brackets. The auto statement must be the first statement in a function definition.
The define statement defines a function. The parameters may be ordinary identifiers or array names. Array names must be followed by empty square brackets.
The return statement causes termination of a function, popping of its auto variables, and specifies the result of the function. The first form is equivalent to return(0). The result of the function is the result of the expression in parentheses.
The quit statement stops execution of a BC program and returns control to UNIX when it is first encountered. Because it is not treated as an executable statement, it cannot be used in a function definition or in an if, for, or while statement.