What is the effect of break statement in a switch statement?
Please give answer in ur own words.
Answers
Answered by
1
when the compiler reaches the break statement in any case, the control of program comes out of switch, and the next statement after the closing braces of switch case is executed
for example
switch (ch)
{
case 1: //body of case 1
break;
case 2: // body
break;
}
// rest of the statements
after executing any case , the computer will reach break command, and will come out of switch to execute rest of the statements after brace ends.
MARK AS BRAINLIEST
for example
switch (ch)
{
case 1: //body of case 1
break;
case 2: // body
break;
}
// rest of the statements
after executing any case , the computer will reach break command, and will come out of switch to execute rest of the statements after brace ends.
MARK AS BRAINLIEST
Similar questions
Geography,
6 months ago
Social Sciences,
6 months ago
Biology,
1 year ago
Biology,
1 year ago
Physics,
1 year ago