Ask Question
25 March, 19:31

What type of selection can be used in leu of switch/case?

+3
Answers (2)
  1. 25 March, 20:32
    0
    In lieu of a switch/case statement, you can use an if/else statement. For example:

    switch (x)

    {

    case 100:

    System. out. println ("Good grades! Keep it up!");

    case 50:

    System. out. printfln ("Bad grades! Work harder!");

    }

    OR, you can use if/else:

    if (x = = 100):

    Sytstem. out. println ("Good grades! Keep it up!");

    if (x = = 50):

    System. out. printfln ("Bad grades! Work harder!");
  2. 25 March, 23:02
    0
    An if or else statement can be
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What type of selection can be used in leu of switch/case? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers