M supports the following control flow statements if then/else, for loop and while loop. The ternary operator
? is also suported for brevity of if-else expression.
use bool variable
only if but no else branch
use ternary operator
if 0 statement
use false literal
else if statement - choose first branch
else if statement - choose second branch
else if statement - choose third branch
else if statement - choose else branch
for loop statement
for loop statement using float type
for loop statement with step variable
nest for loop statement
implement factorial using recursive
implement factorial using for loop
use break statement in for loop
use break statement in for-loop without using if-statement
use break statement in for-loop without using if-statement