Sei sulla pagina 1di 8

1) Which of the following denote stream classes in C++?

a) ios b) fstream c) ostream d) All the Above 2) cin a) b) c) d) in C++ program uses the operator >> < << >

3) Which of the following denote types of polymorphism in C++? a) Virtual function b) Function overloading c) Operator Overloading d) All the Above 4) A condition that must be true on exit from a member function if called as a) Precondition b) Post-condition c) Both A and B d) None of the Above 5) In a C++ program each statement is ended with the character a) . b) ; c) * d) : 6) The header file that must be included while using cout function in a C++ program is a) conio.h b) math.h c) iostream.h d) None of the Above 7) The variable that contains address of another variable is called as a) Pointer b) arrays c) unions d) None of the Above 8) Which of the following language given below uses the concepts of OOPS? a) C++ b) C# c) Java d) All the Above 9) The output of operation 20%3 is a) 6 b) 2 c) 1 d) 4 10) In Late binding the function calls gets resolved during a) Compile Time b) Run Time c) Both A and B d) None of the Above 11) The class that in C++ for file input is a) ifstream

b) ofstream c) Both A and B d) None of the Above 12) The operator that denotes address of a variable in C++ program is a) * b) % c) $ d) & 13) The notation of ternary operator is a) & b) ?: c) ~ d) % 14) Which of the following denote bitwise operators of C++? a) ^ b) << c) ~ d) All the Above 15) The isolation of data from direct access by a C++ program is called as a) Data Hiding b) Data Encapsulation c) Data Isolation d) None of the Above 16) What is the notation used to place block of statements in a looping structure in C++? a) % % b) ( ) c) { } d) None of the Above 17) Which of the looping structure in C++ check condition at the beginning of loop? a) do-while b) while c) Both A and B d) None of the Above 18) The friend function of a class in C++ can access a) Private members of the class b) protected members of the class c) Both A and B d) None of the Above 19) Which of the following allocates memory but does not initialize it? a) operator delete b) operator new c) Both A and B d) None of the Above 20) Reference to its own class can be accepted by a) simple constructor b) copy constructor c) Both A and B d) None of the Above 21) Index of an array starts from a) One b) Zero c) Two

d) None of the Above 22) Which of the following is used to store data of different types? a) Arrays b) Structures c) Both A and B d) None of the Above 23) What is used to convert C++ source code into object modules? a) Compiler b) Linker c) Both A and B d) None of the Above 24) Which of the following denote advantages of inheritance? a) saves program development time b) code reusability c) Both A and B d) All the Above 25) Which of the following exists in C++? a) virtual destructor b) virtual constructor c) Both A and B d) None of the Above 26) Which of the following denote operator of logical AND in C++? a) && b) and c) & d) !& 27) The block of memory allocated by the new is released by using a) delete b) realloc c) Both A and B d) None of the Above 28) cout in C++ program uses the operator a) >> b) < c) << d) > 29) Which of the following is mandatory for all C++ program? a) main() b) scanf() c) system() d) All the Above 30) Class that reads and writes to an array in memory is a) ostream b) ifstream c) strstream d) None of the Above 31) When dynamically allocated memory is lost to the C++ program then a) warning occurs b) memory leak occurs c) The program executes successfully d) None of the above

32) Which of the following operators cannot be overloaded? a) sizeof b) :: c) :? d) All the Above 33) Comments in C++ program is written by using a) / / b) // c) /* /* d) * * 34) The member functions of a class can be defined outside the class using a) Extraction Operator b) Insertion Operator c) Scope resolution operator d) None of the Above 35) Which of the following remains static in a C++ program? a) Class b) Object c) Both A and B d) None of the Above 36) Pure virtual function in C++ is one in which the virtual function a) has no body b) has at least one member c) which cannot be inherited d) None of the Above 37) Which of the following denotes growable array? a) Vector b) ArrayList c) Both A and B d) None of the Above 38) A function defined within a class is called as a) Member Function b) Class Function c) Object Function d) None of the Above 39) A function in a C++ program can be called a) Only Once b) Cannot be called at all c) Any number of times d) None of the Above 40) For the class exforsys defined as below: class exforsys() { }; int main() { exforsys a; } Which of the following is TRUE? a) No default constructor is provided by the compiler b) The compiler provides the default constructor c) The compiler generates error d) None of the Above 41) Which of the following is returned by the operating system if a C++ program completes successfully? a) No Value Returned b) -1 c) 1 d) 0

42) Which of the following is allowed for the value of subscript variable? a) Positive Integer b) Negative Integer c) Both A and B d) Float 43) Which of the following notation compares two variables X and Y? a) X==Y b) X=Y c) X%Y d) X equals Y 44) Which of the following denotes feature of OOPS? a) Inheritance b) Encapsulation c) Polymorphism d) All the Above 45) Which of the following denote C++ looping statement? a) while b) do-while c) for d) All the Above 46) A template can be instantiated by a) Explicit Instantiation b) Implicit instantiation c) Both A and B d) None of the Above 47) The notation of member access operator in structures is a) & b) . c) $ d) * 48) A variable modified by multiple threads should be declared as a) global b) static c) volatile d) Non of the Above 49) The new operator in C++ a) Initialize the allocated memory b) Allocates memory for the object c) Both A and B d) None of the Above 50) The data members and member functions that are only available to derived classes are a) private b) public c) protected d) None of the Above 51) Strict parameter type checking is followed with which of the following? a) Inline b) Macros c) Both A and B d) None of the Above 52) The function named as exforsys declared as int exforsys(float x, double y) has return type as a) double

b) int c) float d) Non of the Above 53) Virtual functions are defined in a) Derived class b) Base class c) Both A and B d) Non of the Above 54) The variables that are used to represent individual array element in an array is called as a) Pointer Variable b) Subscripted variable c) Index Variable d) Real Variable 55) Which of the following is used in C++ to create a copy of an object? a) Assignment operator b) Copy constructor c) Both A and B d) Non of the Above 56) What is the value of variable z when the following program segment ends? int z; for(z=0; z<50; z++) {} a) 51 b) 49 c) 50 d) 0 57) The header that should be included while using manipulators in C++ is a) iomanip.h b) manip.h c) ifstream.h d) Non of the Above 58) The value of EOF is a) 1 b) 0 c) Infinity d) -1 59) The vtable entry for a pure virtual function in C++ is a) zero b) NULL c) one d) No Entry in vtable 60) The variables that can be used only within the function in which it is declared is called as a) Global Variables b) Local Variables c) Both A and B d) None of the Above 61) The first fully Object-oriented language is a) Java b) C++ c) Simula d) Non of the Above 62) What is the keyword used to allocate memory in C++? a) assign

b) malloc c) new d) Non of the Above 63) RAiI stands for a) Read Acquisition is Initialization b) Resource Acquisition is Initializer c) Resource Acquisition is Initialization d) Non of the Above 64) Which of the following can be used to initialize a newly declared variable from an existing variable? a) Virtual Function b) Namespaces c) copy constructor d) None of the Above 65) The class with name exforsys and having integer data x in its have constructor name as a) exforsys b) x c) any name d) Non of the Above 66) Which of the following denote insertion operator in C++? a) & b) >> c) << d) ! 67) Mutable keyword can be applied to a) non-static data members of a class b) non-const data members of a class c) Both A and B d) None of the Above 68) Which of the following denote library function in C++? a) isalpha b) isdigits c) isspace d) All the Above 69) The array exforsys[10] can be declared using pointers as a) % exforsys[] b) & exforsys[] c) * exforsys[] d) @ exforsys[] 70) If a function in C++ does not return a value then its return type is denoted as a) float b) int c) void d) None of the Above

Vocabulary

Allocate , , Bitwise - , Compare - , , Condition - Denote , Derived - , Exist

Explicit - Feature - , Implicit Inheritance , Inline Loop Mandatory - , Memory leak Mutable - , , Release - , Resolution Resolve Reusable - Scope - , , Stream Subscript - (, ) Subscripted variable Provide , , Template Volatile - , , Vtable -

Potrebbero piacerti anche