Introduction To Object Oriented Programming & C++ V1
Introduction To Object Oriented Programming & C++ V1
d. None of above
Q2. What is the only function all C++ programs must contain?
A. start()
B. system()
C. main()
D. program()
Q3. What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and <C. BEGIN and END
D. ( and )
Q4. What punctuation ends most lines of C++ code?
A. . (dot)
B. ; (semi-colon)
C. : (colon)
D. ' (single quote)
Q5. Which of the following is a correct comment?
A. */ Comments */
B. ** Comment **
C. /* Comment */
D. { Comment }
Q6. Which of the following is not a correct variable type?
A. float
B. real
C. int
D. double
Q7. Which of the following is the correct operator to compare two variables?
A. :=
B. =
C. equal
D. ==
Q8. Which of the following is true?
A. 1
B. 66
C. .1
D. -1
E. All of the above
Q9. Which of the following is the boolean operator for logical-and?
A. &
B. &&
C. |
D. |&
Q10. Evaluate !(1 && !(0 || 1)).
A. True
B. False
C. Unevaluatable
Q11. Every statement in C++ program should end with
a. A full stop (.)
b. A Comma (,)
c. A Semicolon (;)
d. A colon (:)
Q12. C++ was originally developed by
1. Nicolas Wirth
2. Donald Knuth
3. Bjarne Stroustrup
4. Ken Thompson
Q13. The standard c++ comment
1. /
2. //
3. /* and */
4. None of these
Q14. The preprocessor directive #include is required if
1. Console output is used
2. Console input is used
3. Both console input and output is used
4. None of these
Q15. The operator << is called
1. an insertion operator
2. put to operator
3. either a or b
4. None of these
Q16. The operator >> is called
1. an extraction operator
2. a get from operator
3. either a or b
4. get to operator
Q17. When a language has the capability to produce new data type, it is called
1. Extensible
2. Overloaded
3. Encapsulated
4. Reprehensible
Q18. The C++ symbol <<
1. perform the action of sending the value of expression listed as its right to
the outputs
strewn as the left.
2. is used to indicate the action from right to left
3. is adopted to resemble an arrow
4. All the above
Q19. What is a reference?
1. an operator
2. a reference is an alias for an object
3. used to rename an object
4. None of these
Q20. A constructor is called whenever
1. a object is declared
2. an object is used
3. a class is declared
4. a class is used
Q21. State the object oriented languages
1. C++
2. Java
3. Eiffel
4. All of the above
Q22. Overload function in C++
1. a group function with the same name
2. all have the same number and type of arguments
3. functions with same name and same number and type of arguments
4. All of the above
Q23. Operator overloading is
1. making c++ operators works with objects
2. giving new meaning to existing c++ operators
3. making new c++ operator
4. both a& b above
Q24. A constructor is called whenever
1. a object is declared
2. an object is used
3. a class is declared
4. a class is used
Q25. A class having no name
1. is not allowed
value
Q36. If you use same variable for two getline statements
a. Both the inputs are stored in that variable
b. The second input overwrites the first one
c. The second input attempt fails since the variable already got its value
d. You can not use same variable for two getline statements
Q37. The return 0; statement in main function indicates
a. The program did nothing; completed 0 tasks
b. The program worked as expected without any errors during its execution
c. not to end the program yet.
d. None of above
Q38. The size of following variable is not 4 bytes in 32 bit systems
a. int
b. long int
c. short int
d. float
Q39. Identify the correct statement regarding scope of variables
a. Global variables are declared in a separate file and accessible from any prog
ram.
b. Local variables are declared inside a function and accessible within the func
tion only.
c. Global variables are declared inside a function and accessible from anywhere
in program.
d. Local variables are declared in the main body of the program and accessible o
nly from
functions.
Q40 cin extraction stops execution as soon as it finds any blank space character
a. true
b. false
Contact www.solvedcare.com for best and lowest cost solution or email solvedcare
@gmail.com