What will be the output of the following code fragment when the input to chis i) 'A' ii) 'D'
switch(ch)
{
case 'A': System.out.println("Grade A");
case 'B': System.out.println("Grade B");
case 'C': System.out.println("Grade C");
break;
case 'D': System.out.println("Grade D");
default : System.out.println("Grade P);
}
Answers
Answered by
5
Explanation:
System.out.println("Grade A");
case 'B': System.out.println("Grade B");
case 'C': System.out.println("Grade C");
break;
Answered by
2
Answer:
System.out.println("Grade A");
System.out.println("Grade B) System.out.println("Grade C");
break;
System.out.println("Grade D");
default : System.out.println("Grade P);
}
Similar questions