CSC201 Past Questions and Answers
CSC201 Past Questions and Answers
1. A Translator which is used to convert codes written in high level languages to a machine
language is known as ____________
(A). Assembler
(B). Debugger
(C). Compiler
(D). Converter
(Ans) C
2. Errors in a computer program are referred to as ________
(A). Mistakes
(B). Bugs
(C). None of the above
(D). Crash
(Ans) B
3. What is the size of int data type in C++?
(A). 2 Bytes
(B). 4 Bytes
(C). 1 Byte
(D). 8 Bytes
(Ans) A
4-6 In C++, assume variable A holds 2 and variable B holds7 then arithmetic operation
4. B*A gives _______________
(A) 9
(B) 14
(C) 49
(D) -14
(Ans) B
5. B%A gives ____________
(A) 0
(B) 3
(C) 1
(D) 2
(Ans) C
A. Data hiding
B. Dynamic typing
C. Dynamic binding
D. Dynamic loading
Ans. D
42. Which of the following statement is correct?
A. Inheritance
B. Polymorphism
C. Abstraction
D. Encapsulation
Ans. B
56. Which of the following is the correct way of declaring a function as constant?
A. const int ShowData(void) { /* statements */ }
B. int const ShowData(void) { /* statements */ }
C. int ShowData(void) const { /* statements */ }
D. Both A and B
Ans. C
57. Which of the following concepts is used to implement late binding?
A. Virtual function
B. Operator function
C. Const function
D. Static function
Ans. A
58. Which of the following statement is correct?
A. this->x
B. this.x
C. *this.x
D. *this-x
Ans. A
61. Which of the following is correct about the statements given below?
A. Multiple
B. Multilevel
C. Distributive
D. Hierarchical
Ans. C
65. Which of the following operators cannot be overloaded?
A. []
B. ->
C. ?:
D. *
Ans. C
66. In which of the following a virtual call is resolved at the time of compilation?
A. It speeds up execution.
B. It slows down execution.
C. It increases the code size.
D. Both A and C.
Ans. D
68. Which one of the following is the correct way to declare a pure virtual function?
A. virtual void Display(void){0};
B. virtual void Display = 0;
C. virtual void Display(void) = 0;
D. void Display(void) = 0;
Ans. C
69. Which of the following header file includes definition of cin and cout?
A. istream.h
B. ostream.h
C. iomanip.h
D. iostream.h
Ans. D
70. Which of the following keyword is used to overload an operator?
A. overload
B. operator
C. friend
D. override
Ans. B
71. What will happen if a class is not having any name?
A. Multilevel inheritance
B. Multiple inheritance
C. Hybrid inheritance
D. Hierarchical Inheritance
Ans. B
73. Which one of the following is correct about the statements given below?
A. public
B. private
C. protected
D. friend
Ans. D
75. Which of the following function prototype is perfectly acceptable?
A. Two functions having same number of argument, order and type of argument can be overloaded
if both functions do not have any default argument.
B. Overloaded function must have default arguments.
C. Overloaded function must have default arguments starting from the left of argument list.
D. A function can be overloaded more than once.
Ans. D
79. Which of the following statement will be correct if the function has three arguments passed to it?
A. Member function
B. Static function
C. Virtual function
D. Both B and C
Ans. C
83. Which of the following function declaration is/are incorrect?
A. A default argument is checked for type at the time of declaration and evaluated at the time of
call.
B. We can provide a default value to a particular argument in the middle of an argument list.
C. We cannot provide a default value to a particular argument in the middle of an argument list.
D. Default arguments are useful in situations where some arguments always have the same value.
Ans. B
89. Which of the following statement is correct?
Once a reference variable has been defined to refer to a particular variable it can refer to any other
variable.
A reference is not a constant pointer.
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.
Ans. D
94. Functions can be declared to return a reference type. There are reasons to make such a
declaration/Which of the following reasons are correct?
The information being returned is a large enough object that returning a reference is more efficient than
returning a copy.
The type of the function must be a R-value.
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.
Ans. C
95. Which of the following statements is correct?
A. &&
B. &
C. ||
D. !
Ans. B
98. Which of the following statement is correct?
A. Once a reference variable has been defined to refer to a particular variable it can refer to any
other variable.
B. A reference is indicated by using && operator.
C. Once a reference variable has been defined to refer to a particular variable it cannot refer to any
other variable.
D. A reference can be declared beforehand and initialized later.
Ans. C
99. Which of the following statements is correct?