Top 1000+ Object Oriented Programming (OOP) Subject Mcqs Pdf Download Set No 13

Print/Downlaod pdf

601.What will be the value of ‘a’ and ‘b’ after executing the following statements?

  1. A = 3;
  2. b = a++;
  3. 3, 4
  4. 4, 4
  5. 3, 3
  6. 4, 3

602.Consider the following code segment. What will be the output of following code?

Int add Value (int *a {

int b = (*a + 2;

return b;

}

main (

int x =6;

Cout << x << “,”;

Cout << add Value (&x << “,”;

Cout << x;

}

  1. 6,8,6
  2. 6,6,8
  3. 6,8,8
  4. 6,6,6

603…….is used to trace the logic of the program and correct the logical errors?

  1. Compiler
  2. Editor
  3. Linker
  4. Debugger

604. The new and delete are whereas Malloc and free are?          

  1. Functions, operators
  2. Classes, operators
  3. Operators, functions
  4. Operators, classes

605. The member functions can also access the private data members of a class?

  1. Non-member functions
  2. Friend functions
  3. Any function outside class
  4. None of the given options

606.Which situation would require the use of a non-member overloaded operator?

  1. The overloaded operator is an Assignment operator.
  2. The left most operand is an object of a class.
  3. The left operand is built-in data type.
  4. The operator returns a reference.

607.The stream insertion and stream extraction operators are already overloaded for          

  1. User-defined data types
  2. Built-in data types
  3. User-defined and built-in data types
  4. None of the given options

 608.If we define an identifier with the statement #define PI 3.1415926 and execution will be?                 

  1. cannot be replaced
  2. None of the given options
  3. Remain constant can be changed by some operation
  4. none

609. The Assignment operator is associative?

  1. right
  2. left
  3. binary
  4. unary

610.When dynamic memory allocation is made in C/C++, it is freed?                        

  1. Explicitly
  2. Implicitly
  3. Both explicitly and implicitly
  4. None of the given options                  
  5. int
  6. char
  7. none of the given options.

612.Which of the following function do NOT initialize the chunk of memory to all zero?

  1. C allocation function
  2. M allocation function
  3. Both malloc and c allocation
  4. None of the above

613. The function free memory allocation to?         

  1. stack
  2. heap
  3. stack and heap
  4. None of the given options

614.Width is function of?           

  1. Cin object
  2. Both Cin and Cout object
  3. Cout object
  4. None of the given option

615.Templates are not type safe?

  1. False
  2. true

616.A Matrix can be composed of int, floats or doubles Write a separate class to handle each?

  1. Use strings to store all types
  2. Use template
  3. None of the given options

617. If structure the block of statements is executed only?

  1. When the condition is false
  2. When it contains arithmetic operators
  3. When the condition is true
  4. When it contains logical operators

 618.Header file: f stream.h includes the definition of the stream classes?                  

  1. Ifstream and fstream, cout
  2. if stream, of streams, of stream
  3. fstream, cin, cout
  4. None of the above

619.To access the data members of structure is used?

  1. dot operator
  2. B*operator
  3. U operator
  4. None of given.

620. eof(  bad( , good( , clear(  all are manipulators?

  1. Yes
  2. No

621.Which kind of functions can access private member variables of a class?

  1. Friend functions of the class
  2. Private member functions of the class
  3. Public member functions of the class
  4. Friend, private and public functions

622. The return type of operator function always will be void?

  1. True
  2. False

623. Friend function of a class is?                            

  1. Member function
  2. Non-member function 
  3. Private function
  4. Public function

624. The Function implementation of friend function must be defined outside the class.

  1. True
  2. False

625.The l Way of Cin object is?

  1. File
  2. Disk
  3. Keyboard
  4. RAM

626.Which is correct way to initialize a variable x of int type with value 10?

  1. int x ; x = 10
  2. int x = 10;
  3. int x, x = 10;
  4. x = 10;

627.Consider the following code segment. What will be the output of the following program?

int func(int ;

int num = 10;

int main {int num ; num = 5 ;

cout << num;

cout << function num ;

}

int func(int x{

return num;

}

  1. 5, 5
  2. 10, 5
  3. 5, 10
  4. 10, 10

628.With template function, the compiler automatically detects the past data and generates a new copy of function using passed data.

  1. True 
  2. False

629.What will be the syntax to declare two-dimensional array of float data type?

  1. float arr{2}{2};
  2. float arr[2][2] ;
  3. float arr[2,2] ;
  4. float [2][2] arr;

630.The first parameter of operator function for << operator,

  1. Must be passed by value
  2. Must be passed by reference
  3. Can be passed by value or reference
  4. Must be object of class

631.Heap is constantly changing in size.

  1. True
  2. False

632. For calling function, the arguments are assigned to the parameters ?                         .

left to right 295

  1. right to left
  2. no specific order is followed
  3. none of the given options.

 633.Classes defined inside other classes are called

  1. classes
  2. looped
  3. nested
  4. overloaded
  5. none of the given options.

634.If we will define an identifier with the statement the value of PI?                 

  1. cannot be replaced
  2. None of the given options
  3. Remain constant
  4. can be changed by some operation

635.Which value is returned by the destructor of a class?

  1. A pointer to the class.
  2. An object of the class.
  3. A status code determining whether the class was destructed correctly
  4. Destructors do not return a value

636.Every class contains                              

  1. Constructor
  2. Destructor
  3. Both a constructor and a destructor
  4. None of the given options

637.A template function must have?

  1. One or more than one argument
  2. Only one argument
  3. Zero arguments
  4. None of the given options

638.Structured Query Language will be for?

  1. Databases Management
  2. Networks
  3. Writing Operating System
  4. none of the given options

639.When a call to a user-defined function finishes, the variable defined inside the function?

  1. True
  2. False

640.The precedence of an operator can be changed by operator overloading?

  1. True
  2. False

641. Matrix can be composed of different data types which is best way for this?

  1. Use templates
  2. Use strings to store all types
  3. None of the given options

 642. The “delete” operator is used to return memory to free store

  1. True
  2. False

643.The variable of the pointer will be stored?

  1. Data
  2. Memory Address
  3. Data Type
  4. Values

644.All preprocessor directives will be started with the symbol?          

  1. *
  2. +
  3. @
  4. #

645.The class1=class2; class1 will call the assignment operator function and class2 will be passed as an argument to function.

  1. True
  2. False

646.What is the sequence of event?

  1. Only block of memory is de allocated for objects
  2. Only destructor is called for objects
  3. Memory is de allocated first before calling destructor
  4. Destructor is called first before de allocating memory

647.The second parameter of operator functions for << and >> are objects of the

  1. False
  2. true

648To include code from the library in the program such as directive using this command.

  1. #include “iostream.h”
  2. include <iostream.h>
  3. include <iostream.
  4. #include <iostream.h>

649.The number 544.53 must be stored in data type?

  1. int
  2. short
  3. float
  4. char

650.A template function can have different type of arguments?

  1. True
  2. False