Practice question
3 marksState three differences between the if-else construct and the switch-case construct.
Conditional ConstructsMediumShort answer
Computer Science · Class 11 · ISC
The if, if-else and nested if-else statements, the switch-case statement, and the fall-through.
5questions
Syllabus mapping: ISC syllabus (CISCE) (opens CISCE's website in a new tab)
5 questions
Practice question
3 marksState three differences between the if-else construct and the switch-case construct.
Conditional ConstructsMediumShort answer
Practice question
3 marksWrite a Java program segment using a switch to print the name of the day for a number from 1 to 7.
Conditional ConstructsMediumApplication based
Practice question
3 marksWrite a Java program segment that reads an integer and prints whether it is positive, negative or zero.
Conditional ConstructsMediumApplication based
Practice question
3 marksWhat is the output of the following, and why? int x = 2; switch (x) { case 1: System.out.print("A"); case 2: System.out.print("B"); case 3: System.out.print("C"); }
Conditional ConstructsMediumNumerical
Practice question
3 marksWrite a Java program segment that reads three numbers and prints the largest.
Conditional ConstructsMediumApplication based