Mathpar system lets you create your procedures and functions. To do this, use the command procedure. After the command procedure, you must specify the name of the procedure, and then in the curly brackets describes the procedure itself.
You can use the operators of branching and looping:
if () { } else { } — the operator of branching;
while () { } — cycle operator with precondition;
for ( ; ; ) { } — cycle operator with the counter.