answersLogoWhite

0

Old:

if (condition) stmt1;

else stmt2;

New:

int cc = (condition)!=0;

switch (cc) {

case 1:

stmt1;

break;

case 0:

stmt2;

break;

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is compared with the value that follows each of the case statements when a switch statement executes?

The expression in the switch statement is evaluated. The result of this evaluation is then compared with each case statement in turn until a matching case is found, which then forces a jump to the appropriate case. Execution then continues from that point until a break, return or goto statement is encountered, or execution falls through the switch statement.


Can a continue statement be used in a switch statement?

If you have a loop in your switch statement or around your switch statement, you can use the continue statement in that. You cannot use a continue statement outside of a loop (do, for, or while).


What is the difference between 'switch' statement and 'if' statement?

we can use switch statement in multiple time but in if statement we can not use multiple time


What is the deffernce of the switch statement and the if statement in c plus plus?

If statement is single selection statement,whereas the switch statement is multiple selective.


What does default mean in switch statement?

Default clause in switch statement used to indicate that the desired option is not available with the switch case statement. it is similar to else statement of if statement which is used when the condition does not satisfy.


What is the code for dropping the animals on the person for nabooti?

first you turn switch 4 then turn switch 2 then turn switch 3 then turn switch 1


What is the use of switch statement in java?

In java, a switch statement is used to simplify a long list of 'if' statements. A switch statement takes the form of:switch (variableName){case condition1; command1;case condition2; command2;...}


Where is the multifuction switch located in a Dodge Durango?

The turn signal switch is part of the multifunction switch.The turn signal switch is part of the multifunction switch.


Explain with suitable example how switch statement is differ from if statement?

www.assignmentsclub.com


How do you break a loop in a switch case statement?

using break; statement


Where is the multifunction switch located on 2002 Dodge Intrepid?

The turn signal switch is part of the multifunction switch.The turn signal switch is part of the multifunction switch.


What programming languages use a C switch statement?

There are two programming languages which use a C switch statement. The two languages are C and C++, hence the name C switch statement. There may be more, but those are the most obvious ones