Answer:
2
Explanation:
if-else is the statement that is used for checking the condition and if the condition is True, then execute the statement otherwise not executed.
initially, the value of n1 = 3, n2 = 6, n3 = 2, sumtotal = 4.
after that, if statement checks for the condition.
3 != 4
condition is TRUE, then the statement sumtotal -= n3; will be executed.
write the statement in simple form:
sumtotal = sumtotal - n3;
so, sumtotal = 4-2 = 2.
after that, the program does not check the further and exit the if-else statement.
Therefore, the answer is 2.
Answer:You cant carry it around like a phone
Explanation:
So that they can lower the I2R losses
Answer:
The answer to this question is given in the explanation section.
Explanation:
Let look at an if the else statement
if (condition1) {
//some code if condition 1 is true
} else if (condition2) {
// some code if condition 2 is true
} else {
// some code if condition 3 is true
}
No let look at switch statement
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
Now let look at your answer.
if then else should be replaced with switch if conditions are fixed.
in the process of replacing
write your condition of if statement in the case area of swatch