User Guide

if not(type(x, integer)) then
printf("%a is not an integer.", x);
elif x >= 0 then
printf("%a is an integer with one digit.", x);
elif x >= 10 then
printf("%a is an integer with more than one digit.", x);
end if;
>
11 is an integer with one digit.
elif and else Clauses
In an if statement with elif and else clauses, Maple evaluates the conditional
expressions in order until one returns true. Maple executes the corresponding
statement sequence, and then exits the if statement. If no evaluation returns
true, Maple executes the statement sequence in the else clause.
x := -12:>
if not type(x, integer) then
printf("%a is not an integer.", x);
elif x >= 10 then
printf("%a is an integer with more than one digit.", x);
elif x >= 0 then
printf("%a is an integer with one digit.", x);
else
printf("%a is a negative integer.", x);
end if;
>
-12 is a negative integer.
For more information on the if statement, refer to the ?if help page.
Repetition (for Statement)
Using repetition statements, you can repeatedly execute a statement se-
quence. You can repeat the statements in three ways.
8.2 Flow Control 325