Chapter 6. Control Structures

Table of Contents

If
Switch
For
While

If

There are two ways of writing if statements

if(test1)
{
    code1;
}
elseif(test2)
{
    code2;
}
else
{
    code3;
};
if test1
    code1;
elseif test2
    code2;
else
    code3;
end;