MATLAB Programming set 5

Que.What is the output of the following code?
if(1)
    p=9;
    end

a. p=9
b. Output is suppressed but p=9
c. Error
d. Nan
Que.What is the output of the following code?
num=2;
    switch num
    case[2 3 4]
    p=9;
    case[1 5 6]
    q=9;
    end

a. No output
b. p=9
c. q=9
d. Output suppressed but p=9
Que.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
Que.Before starting a new case, we have to end the previous case using ___________
a. Break statement
b. Continue statement
c. Return statement
d. No statement
Que.We cannot use a ____ statement in the standalone if-else structure.
a. break
b. if-else
c. return
d. switch-case
Que.The continue statement can be used in a switch-case structure.
a. True
b. False
c. May be True or False
d. Can’t say
Que.We cannot use a ____ statement if the if-else structure is not part of a loop.
a. continue
b. if-else
c. clc
d. plot()
Que.What will be the output of the following code?
if(cos(Inf)==NaN)
    p=1;
    end

a. p=1
b. Output suppressed but p=1
c. Error
d. No output
Que.What will be the output of the following code?
switch num
    case ‘a’
    p=394;
    case ‘b’
    c=0;
    end

a. Error
b. No output since we haven’t given num a value yet
c. p=394
d. c=0
Que.If a logical expression is true, it will always return a logical 1 and if it’s false, it’ll always return a 0.
a. True
b. False
c. May be True or False
d. Can’t say