Ask Question
13 March, 05:38

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

+4
Answers (2)
  1. 13 March, 06:41
    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. 13 March, 08:58
    0
    An if or else statement can be
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What type of selection can be used in leu of switch/case? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers