Computer Applications
Convert the following if else if construct into switch case:
if (ch== 'c' || ch=='C')
System.out.print("COMPUTER");
else if (ch == 'h' || ch =='H')
System.out.print("HINDI");
else
System.out.print("PHYSICAL EDUCATION");
Related Questions
Write a program to input three numbers (positive or negative). If they are unequal then display the greatest number otherwise, display they are equal. The program also displays whether the numbers entered by the user are 'All positive', 'All negative' or 'Mixed numbers'.
Sample Input: 56, -15, 12
Sample Output:
The greatest number is 56
Entered numbers are mixed numbers.Which of the following data type cannot be used with switch case construct?
- int
- char
- String
- double