adplus-dvertising
frame-decoration

Question

What will be the output of the following code?
switch num
case '2'
p=2;
case '2'
p=4-5;
end

a.

p=2

b.

Error

c.

No output

d.

p=-1

Posted under MATLAB

Answer: (c).No output

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following code?

Similar Questions

Discover Related MCQs

Q. Before starting a new case, we have to end the previous case using ___________

Q. We cannot use a ____ statement in the standalone if-else structure.

Q. The continue statement can be used in a switch-case structure.

Q. We cannot use a ____ statement if the if-else structure is not part of a loop.

Q. If a logical expression is true, it will always return a logical 1 and if it’s false, it’ll always return a 0.

Q. The functioning of all() and any() is same.

Q. What does the function all() do?

Q. Choose the correct hierarchy of operations.

Q. The correct hierarchy of operations is ________

Q. ‘=’ is a?

Q. The ~ is ______

Q. All logical operators operate on at least two operands.

Q. The precedence of : operator is after | and before &.

Q. The precedence of Transpose operation is ____________

Q. All relational operators operate on _______________

Q. In nested loops, the break statement exits the ____ loop.

Q. In nested loops, the continue statement exits the ____

Q. In nested loops, the break statement, if present within a nested if the structure, will exit the _______

Q. In nested loops, the continue statement, if present within an if structure, will exit the ____________

Q. In nested loops, the continue statement, if present within a nested if structure, will exit the ____________