Write a Java program segment that reads three numbers and prints the largest.
Conditional Constructs
Original Khojo Papers practice question — not from a past board paper.
It prints BC.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
Control enters at case 2, and with no break statement it falls through into case 3 and prints C as well.
From the same topic and chapter, at a similar level.
Write a Java program segment that reads three numbers and prints the largest.
Conditional Constructs
Write a Java program segment using a switch to print the name of the day for a number from 1 to 7.
Conditional Constructs
Write a Java program segment that reads an integer and prints whether it is positive, negative or zero.
Conditional Constructs
State three differences between the if-else construct and the switch-case construct.
Conditional Constructs
Explain the ternary operator in Java and rewrite "if (a > b) max = a; else max = b;" using it.
Operators and Expressions in Java
What is the output of: String s = "Examination"; System.out.println(s.length() + " " + s.substring(0, 4) + " " + s.toUpperCase().charAt(2));
String Handling