Ask Question

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

+5
Answers (2)
  1. 6 August, 04:37
    0
    An if or else statement can be
  2. 6 August, 04:46
    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!");
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 & 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