Anna wants to write a program that checks if a number is positive, negative, or zero. Which conditional structure would be most suited for this task?

  • For Loop
  • If-Else Statement
  • Switch Statement
  • While Loop
Anna should use the "If-Else" statement for this task. It allows her to evaluate a condition (in this case, whether the number is positive, negative, or zero) and execute different code blocks based on the result.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *