s.y.b.sc . -III Computer Cppi
s.y.b.sc . -III Computer Cppi
Question Bank
----------------------------------------------------------------------------------------------------------------------------
A. Copy constructor
B. Friend constructor
C. Default constructor
D. Parameterized constructor
A. Static function
B. Friend function
C. Const function
D. Virtual function
3 Which of the following concepts means determining at runtime what method to invoke?
A. Data hiding
B. Dynamic Typing
C. Dynamic binding
D. Dynamic loading
4 Which of the following term is used for a function defined inside a class?
A. Member Variable
B. Member function
C. Class function
D. Classic function
5 Which of the following concept of oops allows compiler to insert arguments in a function call if it is
not specified?
A. Call by value
B. Call by reference
C. Default arguments
D. Call by pointer
A. Function
B. Class
C. Object
D. Operator function
7 Which of the following concepts of OOPS means exposing only necessary information to client?
A. Encapsulation
B. Abstraction
C. Data hiding
D. Data binding
A. operator
B. function
C. object
D. macro
B. double
C. string
D. Class
A. Top-down
B. Bottom-up
C. Right-left
D. Left-right
D. Both A and B.
B. class data members are public by default while that of structure are private.
14 Which of the following concepts means wrapping up of data and functions together?
A. Abstraction
B. Encapsulation
C. Inheritance
D. Polymorphism
15 Which of the following concepts means waiting until runtime to determine which function to call?
A. Data hiding
B. Dynamic casting
C. Dynamic binding
D. Dynamic loading
A. >>
B. <<
C. +
D. =
A. iostream
B. istream
C. ostream
D. ifstream
D. Initialize objects
C. A syntax error.
D. A run-time error.
A. Virtual function
B. Operator function
C. Const function
D. Static function
21 Which of the following ways are legal to access a class data member using this pointer?
A. this->x
B. this.x
C. *this.x
D. *this-x
A. Operator overloading
B. Function overloading
C. Templates
B. ->
C. ?:
D. *
24 Which of the following header file includes definition of cin and cout?
A. istream.h
B. ostream.h
C. iomanip.h
D. iostream.h
A. overload
B. operator
C. friend
D. override
A. public
B. private
C. protected
D. friend
A. A static member function can access only static data members of a class.
B. A static data member is shared among all the object of the class.
D. Both A and B.
A. Yes
B. No
C. May Be
D. Can't Say
32 Which of the following function / types of function cannot have default parameters?
A. ! !
B. % %
C. :
D. : :
34 A programmer can create custom header files that must be end with
A. .h extension
B. .l extension
C. .ios extension
D. .a extension
35 Choose the correct statements regarding inline functions.
A. It speeds up execution
B. It slows down execution
C. It decreases the code size
D. Both A and C
36 Choose the correct answer for following piece of C++ pseudo code
int main(){
int a,b;
func(a,b);
(A) inline void foo() { } (B) void foo() inline{} (C) inline:void foo(){} (D) none
(A) Function is defined (B) Function is declared (C) Both (A) and (B) (D) None
44 What should be passed in parameters when function does not require any parameters?
a) void
b) blank space
c) both void & blank space
d) tab space
46 If the user did not supply the value, what value will it take?
a) default value
b) rise an error
c) both default value & rise an error
d) error
47 Which value will it take when both user and default values are given?
a) user value
b) default value
c) custom value
d) defined value
48 To which does the function pointer point to?
a) variable
b) constants
c) function
d) absolute variables
53 Which of the following supports the concept that reusability is a desirable feature of a language?
a) It reduces the testing time
b) It reduces maintenance cost
c) It decreases the compilation time
d) It reduced both testing and maintenance time
#include <stdio.h>
void main()
printf("Hello World");
#include<stdio.h>
int main()
foo();
int foo()
printf("Hello");
return 0;
58 Which of the following is not a fundamental type is not present in C but present in C++?
a) int
b) float
c) bool
d) void
61 Which of the following is the correct difference between cin and scanf()?
a) both are the same
b) cin is a stream object whereas scanf() is a function
c) scanf() is a stream object whereas cin is a function
d) cin is used for printing whereas scanf() is used for reading input
66 What is the index number of the last element of an array with 9 elements?
a) 9
b) 8
c) 0
d) Programmer-defined
A. Yes, always
B. Yes, if program doesn't contain any classes
C. No, because main function is user defined
D. No, never
89 Where does the execution of the program starts?
a) user-defined function
b) main function
c) void function
d) else function
90 What are mandatory parts in the function declaration?
a) return type, function name
b) return type, function name, parameters
c) parameters, function name
d) parameters, variables
91 Which is more effective while calling the functions?
a) call by value
b) call by reference
c) call by pointer
d) call by object
92 How many minimum number of functions should be present in a C++ program for its execution?
a) 0
b) 1
c) 2
d) 3
A. int *ptr
B. int ptr
C. int &ptr
D. All of the above
95 Which of the following gives the [value] stored at the address pointed to by the pointer : ptr?
A. Value(ptr)
B. ptr
C. &ptr
D. *ptr
96 A pointer can be initialized with
A. Null
B. Zero
C. Address of an object of same type
D. All of the above
97 What does the following statement mean?
int (*fp)(char*)
A. Pointer to a pointer
B. Pointer to an array of chars
C. Pointer to function taking a char* argument and returns an int
D. Function taking a char* argument and returning a pointer to int
98 Which operator returns the address of unallocated blocks in memory?
A. Address of a variable
B. Name of the variable
C. Value of the variable
D. None of the above
p = q;
A. b is assigned to a
B. p now points to b
C. a is assigned to b
D. q now points to a