Computer Science, asked by SuryaVarmaCherukuri, 7 months ago

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 Itzabhi001
5

Explanation:

System.out.println("Grade A");

case 'B': System.out.println("Grade B");

case 'C': System.out.println("Grade C");

break;

Answered by abhi3023
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