Reference

Conditionals

Simple single line conditional

  if(condition) statement;

Block conditional

if(condition)
{
  statements;
}

If...else conditional,

if(condition)
{
  statements1;
}
else
{
  statements2;
}

If...else if...else conditional

if(condition1)
{
  statements1;
}
else if(condition2)
{
  statements2;
}
else
{
  statements3;
}

Conditional Operator

In the following a is assigned the value of b if b is less than c otherwise it is assigned the value of c,

  a = (b < c) ? b : c;