Conditional Branching
If Statement
if (bValue == true)
{
sVariable1 = "text";
}
else
{
sVariable2 = "text";
}
if (bValue == true)
{
sVariable1 = "text";
}
Switch - Case
switch (Temp)
{
case 0:
r += 1;
break;
case "green"
r++;
break;
default:
break;
}
Conditional Operator
Conditional Operator
Also known as the Tenary Operator or Conditional Operator.
if (bValue == true) ? sVariable1 = "text" : sVariable2 = "text";
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext