if construct using switch case if (ch =='y')
{x=x-10;
system.out.println(x);}
else
if (ch == 'y' ){
x + = 10 ;
system.out.println (x);}
else
system.out.println( "discontinue"),
Answers
Answered by
2
Explanation:
switch(ch)
{
case 'y':
x += 10;
system.out.println (x);
break;
/*Without break statement it won't stop, we'll use "break" to stop the switch*/
default:
system.out.println("discontinue");
/*No need for "break" statement, as there is nothing after the default and the switch will get stopped automatically*/
}
I hope this will help you.
Similar questions
Science,
1 month ago
Computer Science,
3 months ago
Accountancy,
3 months ago
Science,
9 months ago
Math,
9 months ago