User Input and Screen Output – 1 MCQ’s

Electronics & Communication Engineering MATLAB

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “User Input and Screen Output – 1″.

1. What is the output of the following code?

error(‘Dan !’);

a) No output, it gets suppressed
b) The word Dan ! is displayed
c) No such function
d) Syntactical Error

2. What is the output of the following code?

error(‘ No !!!!’)

a) No !!!!
b) No !!!!
c) Logical Error
d) Symbolic error

3. What is the output of the following code?

error(“Lola !”);

a) Output is suppressed
b) Syntactical error
c) No such function exists
d) It displays Lola !

4. What is the output of the following code?

error(‘Lola ! \n Dan !’);

a) Output is suppressed
b) Symbolic error in \n
c)

    Lola ! 
    Dan !

d) Lola ! \n Dan !

5. What is the output of the following code?

MException('MATLAB:test', '%d * %d= Why?', Inf,Inf)

a)

    MException with properties:
    identifier: ‘MATLAB:test’
    message: 'Inf * Inf= Why?'
    cause: {}
    stack: [0×1 struct]

b)

    MException with properties:
    identifier: “MATLAB:test”
    message: 'Inf * Inf= Why?'
    cause: []
    stack: [0×1 struct]

c)

    MException with properties:
    identifier: ''MATLAB:test’
    message: '%d * %d= Why?'
    cause: {}
    stack: [0×1 struct]

d) Error

6. What is the output of the following code?

MException('Lola!', '%d * %d= Why?', Inf,Inf)

a) Error due to identifier
b) Error due to Inf
c)

    MException with properties:
    identifier: 'Lola!’
    message: 'Inf * Inf= Why?'
    cause: {}
    stack: [0×1 struct]

d) No such command

7. What is the output of the following code?

disp(‘%d’,Inf);

a) Inf
b) No such command
c) Error due to too many arguments
d) Syntactical error

8. What is the output of the following code?

warning(‘Pikapi !’)

a) Warning: ‘Pikapi !’
b) Warning: Pikapi !
c) Warning: ‘Pikapi !’
d) Warning: Pikapi !

9. What is the output of the following code?

sprintf(‘%d’,5)

a) 5
b) ‘5’
c) Syntactical error
d) Logical error

10. What is the output of the following code?

disp(‘ ‘,lola!’ 2’)

a) ‘lola!’ 2
b) ‘ ‘lola!’ 2’
c) ‘lola! 2’
d) Error due to multiple arguments

11. What is the output of the following code?

warning('off')
warning('Pikapi !')

a) No output
b) Warning: Pikapi !
c)

    Warning: Off
    Warning: Pikapi !

d) Syntactical error

12. How many arguments are given to the above command?

disp(‘ ‘lola!’ 2’)

a) Cannot be defined
b) 2
c) 1
d) 0

13. The default exponential order for %e and %E is same.
a) True
b) False

14. What is the output of the following command?

sscanf(‘.1 .2 .3’,%d)

a) []
b)

 
    .1
    .2
    .3

c)

 
    1
    2
    3

d) Error

15. The disp() command cannot print anything but inputs given within string arguments.
a) True
b) False

Leave a Reply

Your email address will not be published. Required fields are marked *