Write an alternative code using switch case for the following segment.
if (k==‟a‟)
System.out.println(“Hari om”);
else if (k==‟b‟|| k==‟c‟)
System.out.println(“Hello”);
else
System.out.println(“Bye”);
Answers
Answered by
1
Answer:
Here is your answer......
well as in the question as the a, b and c are present within double quotes......u can also place it within double quotes keeping in mind that u have to declare the variable ch and k as String.....
I hope it helped....
Please mark as brainliest answer.....
Attachments:
Similar questions
Computer Science,
4 months ago
English,
4 months ago
Geography,
9 months ago
History,
9 months ago
Chemistry,
1 year ago