Computer Science, asked by IpsitaMohanta25, 5 months ago

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 PavoCristatus
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