CPP MCQ PART 2



PAGES: 1    2    3    4    6    7 


16. ………. Provides a value for a variable
a) declaration statement
b) assignment statement
c) definition statement
d) None of the above

17. A collection of variables referred under one name
a) Structure
b) Class
c) Union
d) None of the above

18. A memory location shared by two or more different variables
a) Structure
b) Class
c) Union
d) None of the above

19. The constants defined using enum keyword are
a) Symbols
b) Enumerators
c) Keywords
d) None of the above

20. The operator ?: is
a) Logical operator
b) Relational operator
c) Conditional operator
d) Arithmetic operator

21. A loop containing other loop is
a) Nested
b) Inner
c) Outer
d) None of the above

22. The following statement forces the next iteration of the loop to take place
a) break
b) continue
c) goto
d) None of the above

23. gets() function is available in
a) stdio.h
b) string.h
c) ctype.h
d) stdlib.h

24. In C++, the statements are enclosed within
a) parenthesis
b) square brackets
c) curly brackets
d) None of the above

25. The following tells the compiler where the program begins
a) Function prototype
b) Forward declaration of class
c) main()
d) None of the above

26. << operator is
a) stream insertion operator
b) stream extraction operator
c) left shift operator
d) None of the above

27. “H” is an example of
a) character literal
b) string literal
c) variable
d) None of the above

28. Which of the following statements regarding comments is false?
a) /*..*/
b) Comment beginning with // extends to the end of the line
c) Comments may be nested
d) Comments are used to describe a program

29. C++ is
a) Procedural programming language
b) Structural programming language
c) Object oriented programming language
d) None of the above

30. y=x=2; in C++ will result in
a) compilation error
b) runtime error
c) assignment of value to x then to y
d) None of the above

CHECK ANSWERS


PAGES: 1    2    3    4    6    7