Thursday, August 21, 2025 16:31

Posts Tagged ‘conditional statement switch’

Conditional statement Switch

Monday, January 9th, 2017

As we will see, conditional statement Switch works very much like the If-Else If-Else statement, with only a syntax difference. It executes an instruction based on the calculated value of a condition. The format of the Switch statement is the following:

switch (condition)
{
   case value1:
      instructions;
      break;
   case value2:
      instructions;
      break;
   case value3:
      instructions;
      break;
   //...
Read more