Which Control Flow activity should be used?

Which Control Flow activity should be used?

Question: A developer has a workflow in which the value of a counter needs to be evaluated before the body of the loop is executed. Which Control Flow activity should be used?

  •   Switch
  •   Do While
  •   While
  •   If

Answer

Option B is correct.

Switch and If statements are not loops. While evaluates the variable at the before the loop. The Do While loop does it at the end. Which should read as Do “Something first” while this is happening

Please subscribe to Cameron's YouTube channel