Ask Question

What is the output after running the following code snippet? int number = 600; if (number < 200) { System. out. println ("Low spender"); } else if (number < 500) { System. out. println ("Spending in moderation"); } else if (number < 1000) { System. out. println ("Above average!"); } else { System. out. println ("High Roller!"); }

+4
Answers (1)
  1. 20 May, 05:50
    0
    Above average!

    Explanation:

    The code snippet is testing different values of the integer variable number.

    If number is less than 200 It prints Low Spender

    else If number is more than 200 but less than 500 It prints Spending in moderation

    else if number is more than 500 but less than 100 It prints Above Average!

    In the code snippet given, number is set to 600 So it prints Above Average!
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output after running the following code snippet? int number = 600; if (number < 200) { System. out. println ("Low spender"); } ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers