Conteúdo principal

Programming logic - Decision Commands - Switch

Conditional branches are the commands that the developer programs the machine to make logical decisions.

On this page I will explain the Case conditional branch.

I'll leave here the explanations about the other conditional deviation: If / Then / Else.

 

Switch

This conditional structure has the following logic. It tests the condition in the first option, If the condition is not correct, it goes to the next condition, until it finds the correct condition. In the diagram below you have an algorithm that when you select the value it returns the user type.

 


This example shows this conditional branch

 
 
    Algortimo 1:

Result:
 No results. Select one of the options
Section: