CBSE - MCQ Question Banks (के. मा. शि. बो . -प्रश्नमाला )

PreviousNext

Q. 189601 Write the output of the following program:            #include< iostream.h >             void X(int A, int &B)              {                  A = A+B;                  B = A-B;                   A = A-B;                }                void main()                {             int a = 4, b = 18;                         X(a,b);                         cout << a << ”,” <<  b;                  }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The output is 4,4.


Q. 189602 Find the output of the following program:           void main()            {                     int x = 5, y = 6;                     cout << x++;                     cout << ”,”;                     cout << ++x;                     cout <<  “,”;                     cout << y++ << ”,” << ++y;              }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The output is 5,7,6,8.


Q. 189603 Write the output of the following program:            #include< iostream.h >            static int i = 100;            void abc()            {                    static int i = 8;                    cout << ”first = “  <<  i;             }                    void main()                     {                               static int i = 2;                                abc();   cout << ”second = “ << i << endl;                      }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The output is

first = 8  second = 2 


Q. 189604 Find the syntax error(s), if any, in the following program:         include < iostream.h >         void main()        {               int x,y;  cin >> x;               for(x = 0; x<5, ++x)                     cout  y else cout << x << y;         }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The correct program is

          # include < iostream.h>                  //Correction 1

              void main()

              {

                   int x,y; cin>>x;

                   for(x = 0; x<5; ++x)            //Correction 2

                    cout << y;

                    cout< < x << y;                      //Correction 3

              }

       Correction 1:  The condition is terminated by a comma(,), instead of a
                            semicolon(;).

       Correction 2:  ‘<<’ is missing.

       Correction 3:  else cannot exist without if.


Q. 189605 A function printchar is defined as            void printchar(char ch = ‘*’, int len = 40)             {                         for( int x = 0; x < len; x++)   cout << ch;                         cout << endl;              }             How will you invoke the function printchar for following output: (i)         to print ’*’ 40 times (ii)       to print ‘*’ 20 times (iii)     to print ‘=’ 40 times (iv)     to print ‘=’ 30 times
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

(i)  printchar()
(ii) printchar(‘*’, 20)
(iii) printchar(‘=’,40)
(iv) printchar(‘*’, 30) 


Q. 189606 Identify the problem with the following code and rewrite the corrections:            void big( int &a, int &b);            void main()             {                  const int x = 10;
                 const int x = 12;    
            }              void big(int &a, int &b)             {                      if(a>b)                          a = -1;                      else                          b = -1;              }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The problem in the code is that a function large() is being called by reference and constants are being sent as argument. When a function is invoked by reference only variables can be passed and not the constants and expressions.

Thus, to correct the above problem the calling function main() needs to be changed as follows:
..

..

void main()

{

   int x = 10;

   int y = 12;
}
..

.. // rest of the code remains the same


Q. 189607 Give the output of the following program: # include< iostream.h > void square(int, int); void main() {            int i = 4, j = 10;            square (i,j);            cout <<  i;             cout << j; } void square(int i, int j) {           i = i * j;           j = j * j; }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

The output of the above program is 410.


Q. 189608 In the following program: (i)              How many times will the while loop run? (ii)            What would be the last value of A displayed out? #include< iostream.h > void main() {           int A = 10;            while(++A<15)             {                        cout << A++;              } }
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

(i)  The while loop will run for two times.
(ii)   The last value to be displayed is 13.


Q. 189609 Write a function to find the sum of series.
1+2+3+4+5+6+………………………….upto N terms.
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

//Function to find the sum of series 1+2+3+…………..+N
         int sumseries(int N)

         {

               int i, sum = 0;

               for( i = 0; i< = N; i++)

                            sum = sum + i;

                return(sum);

         }


Q. 189610 Write a function which will take the height of a person in inches and return the height in feet and inches in two separate variables.
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

//Function to convert the inch to feet

         void feet_inch(int inch)

         {

             float feet;

             feet = float(inch)/12;   // Typecasting

             cout << “The person’s height in inch is “ << inch << endl;

             cout<< “ The person’s height in feet is” << feet;

           }


Q. 189611 Write a function that interchanges the value of two integers A and B without using any extra variable.
A. the data members in the class.
B. the data members outside the class.
C. the methods within the class.
D. the objects.

Right Answer is:

SOLUTION

.  //Function to swap A and B without using a third variable

         void SWAP(int A, int B)

          {

                  A = A + B

                  B = A - B;

                  A = A – B;

                  cout << “ntAfter swapping the value of A is ->” << A;

                  cout << “ntAfter swapping value of B is ->” << B;

                  getch();

          }


Q. 189612 If I use virtual function in the base class, then the


A. derived class function would be called.

B. base class function would be called.

C. parent class would be called.

D. global class function would be called.

Right Answer is: A

SOLUTION

A virtual function is one whose behaviour can be overriden within an inheriting class by a function with the same signature.


Q. 189613 The compiler tries to find the best possible match for the function call.
Matching process follows the sequence


A. by searching for exact match, a match through promotion, a match through standard conversion, a match through user defined conversion.

B. by searching for a match through promotion, a match through standard conversion, a match through user defined conversion.

C. by searching for exact match, a match through standard conversion, a match through user defined conversion.

D. by searching for exact match,then a match through promotion.

Right Answer is: A

SOLUTION

The sequence is by searching for exact match, a match through promotion, a match through standard conversion, a match through user defined conversion. A call to an overloaded function is resolved to a particular instance of the function through argument matching.


Q. 189614 Concrete class


A. Can have any number of objects

B. Cannot have objects

C. Generally behaves as a base class

D. Can have neither data nor functions

Right Answer is: A

SOLUTION

A derived class that implements all the missing functionality is called a concrete class . We can create object for concrete classes.  


Q. 189615 An Abstract Class


A. can have only one object

B. can have neither data nor functions

C. cannot access member functions

D. does not generally have objects declared

Right Answer is: D

SOLUTION

In C++ an abstract class  is one which defines an interface, but does not necessarily provide implementations for all its member functions. An abstract class is meant to be used as the base class from which other classes are derived.


Q. 189616 The concept of inheritance supports


A. Reusability of class

B. Renaming of class

C. Decomposing of class

D. Encapsulation of hierarchy

Right Answer is: A

SOLUTION

C++ enhances the feature of reusability through Inheritance.


Q. 189617 What is the error in the following statement ?
“The signature of a function refers to the return type, the function name and the list of arguments with data type”


A. Function signature does not include list of arguments

B. Function signature does not include function name

C. Function signature does not include return type and function name

D. Function signature does not include data types of arguments

Right Answer is: C

SOLUTION

Signature of a function include name of the function with its argument numbers and types.


Q. 189618 Another name for Late Binding is


A. Dynamic binding

B. Static Binding

C. Object Binding

D. Data Binding

Right Answer is: A

SOLUTION

Dynamic binding, because it happens at run time  


Q. 189619 A class implements


A. Data hiding, Encapsulation, Maintenance

B. Function signature, Encapsulation, Abstraction

C. Data hiding, Procedural Paradigm, Abstraction

D. Data hiding, Encapsulation, Abstraction

Right Answer is: D

SOLUTION

Data Hiding is a concept in C++. In C Language Struct can not hide data of its data members. Where as in C++, we got the luxary of hiding data using e different access levels - private, protected, public

Encapsulation is the process of combining data and functions into a single unit called class. 

The concept of abstraction relates to the idea of hiding data that is not needed for presentation. The main idea behind data abstraction is to give a clear separation between properties of data type and the associated implementation details.


Q. 189620 A function’s signature:


A. Gives the list of arguments with type

B. Gives the list of arguments with function’s return type

C. Gives different definitions of the function

D. Gives the different names of the same function

Right Answer is: A

SOLUTION

A function's signature includes the function's name and the number, order and type of its formal parameters.


Q. 189621 Function overloading is a form of


A. Abstraction

B. Polymorphism

C. Encapsulation

D. Concoction

Right Answer is: B

SOLUTION

Polymorphism is the ability to use an operator or method in different ways. Polymorphism gives different meanings or functions to the operators or methods. Poly, referring to many, signifies the many uses of these operators and methods. A single method usage or an operator functioning in many ways can be called polymorphism.


Q. 189622 Polymorphism refers to


A. Representing essential features

B. Bundling data and functions together

C. An entity with some properties

D. Ability to process data in different ways

Right Answer is: D

SOLUTION

Polymorphism is the ability to use an operator or method in different ways. Polymorphism gives different meanings or functions to the operators or methods. Poly, referring to many, signifies the many uses of these operators and methods. A single method usage or an operator functioning in many ways can be called polymorphism. Polymorphism refers to codes, operations or objects that behave differently in different contexts.


Q. 189623 Inheritance refers to


A. The ability to perform according to the situation

B. The ability to acquire features of another class

C. The wrapping up of data and associated functions into a unit

D. Protecting data from access by any function

Right Answer is: B

SOLUTION

Inheritance is the process by which new classes called derived classes are created from existing classes called base classes. The derived classes have all the features of the base class and the programmer can choose to add new features specific to the newly created derived class.


Q. 189624 Data Hiding refers to


A. Ability to be in different forms

B. Representing essential features

C. Making data inaccessible to outside functions

D. Ability to take on features of another class

Right Answer is: C

SOLUTION

Data Hiding is a concept in C++. In C Language Struct can not hide data of its data members. Where as in C++, we got the luxary of hiding data using e different access levels - private, protected, public


Q. 189625 Data Encapsulation refers to


A. Ability to be in different forms

B. Representing essential features

C. Bundling data and functions together

D. Process of argument matching

Right Answer is: C

SOLUTION

Data encapsulation, sometimes referred to as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user. The user can only perform a restricted set of operations on the hidden members of the class by executing special functions commonly called methods.


Q. 189626 Data Abstraction refers to


A. Representing essential features

B. Bundling data and functions together

C. An entity with some properties

D. Ability to be in different forms

Right Answer is: A

SOLUTION

Abstraction is an important feature of Object Oriented programming.  It refers to representing essential features, ignoring background details.


Q. 189627 Object Based programming can be regarded as a subset of


A. Object Obscured programming

B. Object Oriented programming

C. Procedural programming

D. Logical  programming

Right Answer is: B

SOLUTION

Object Oriented programming supports features of Object Based programming along with polymorphism and inheritance.


Q. 189628 Object Based programming does not support


A. Encapsulation

B. Polymorphism

C. Classes

D. Abstraction

Right Answer is: B

SOLUTION

As polymorphism is not supported, overloading and inheritance too are not possible.  


Q. 189629 Instructions are given in sequence in


A. Object Based programming

B. Object Oriented programming

C. Procedural programming

D. Advanced programming

Right Answer is: C

SOLUTION

In Procedural programming, programs are written as a list of instructions in a sequence.


Q. 189630 Programming Paradigm is


A. An approach to programming

B. An outdated programming language

C. Software to analyze  a problem

D. A group of expert programmers

Right Answer is: A

SOLUTION

Programming paradigm is an approach to programming.


Q. 189631 The limitations of object based programming is removed by


A. procedural programming.

B. object oriented programming.

C. object function programming.

D. structural programming.

Right Answer is: B

SOLUTION

Object oriented programming offers all features of object based programming and removes the limitation by implementing inheritance and polymorphism.


Q. 189632 Polymorphism refers to


A. Representing essential features

B. Bundling data and functions together

C. An entity with some properties

D. Ability to process data in different ways

Right Answer is: D

SOLUTION

In simple terms Polymorphism is known as more than one form. C++ acquire polymorphism using Overloading and Virtual Function.


Q. 189633 The limitation of object-based programming is


A. it’s inability to represent real world relationships.

B. that it overcomes shortcomings of procedural programming.

C. that it hides implementation details from users.

D. that it does not implement abstraction and information hiding.

Right Answer is: A

SOLUTION

Object based programming does not support inheritance. For example, both car and truck are vehicles, they cannot be represented in object-based programming.


Q. 189634 A function declared within the definition of a class is called


A. data.

B. method.

C. variable.

D. scope resolution operator.

Right Answer is: B

SOLUTION

A class is a collection of data members and member functions. The functions defined within a class, are called member functions or methods.


Q. 189635 Any two functions in a set of overloaded functions must have


A. without argument list.

B. matched argument list.

C. same argument list.

D. different argument list.

Right Answer is: D

SOLUTION

There are some of the major restrictions on function overloading. Here any two functions in a set of overloaded functions must have different argument list.


Q. 189636 The class, which inherits the properties of other class, is called


A. derived class.

B. base class.

C. super class.

D. inheritable class.

Right Answer is: A

SOLUTION

The capability of one class to inherit the properties of the other class is called inheritance. The class which is inherited is called the base class or the super class and the class which inherits from the other class is a derived class or a sub class.


Q. 189637 The class, whose properties are inherited by other classes, is known as


A. derived class.

B. sub class.

C. super class.

D. inheritable class.

Right Answer is: C

SOLUTION

The capability of one class to inherit the properties of other class is called inheritance. The class which is inherited is called the base class or super class and the class which inherits from other class is derived class or sub class.


Q. 189638 Argument matching in a function call is also known as


A. process of ambiguation.

B. process of disambiguation.

C. process of matching.

D. procedural ambiguity.

Right Answer is: B

SOLUTION

Argument matching involves comparing the actual arguments of the call with the formal parameters of each declared instance of the function. It removes ambiguity.


Q. 189639 Hiding intricate details from the end user, is


A. not an essential principal of system design.

B. a conventional programming approach.

C. same as data abstraction.

D. a way to implement data abstraction.

Right Answer is: D

SOLUTION

Encapsulation is wrapping up of data and functions into a single unit and it is a way to implement polymorphism.


Q. 189640 Procedural language paradigm gives more emphasis on 


A. data than the work performed on it.

B. doing things rather than on data itself.

C. objects and classes.

D. principles of data hiding, abstraction and encapsulation.

Right Answer is: B

SOLUTION

Procedural programming aims at procedures. It is a list of instructions telling a computer, step by step, what to do, usually having a linear order of execution from the first statement to the second.


Q. 189641 The same command, “Speak”, when given to a dog would make him bark, when given to a cow would make it moo and when given to a person would make him talk in words, this illustrates the concept –


A. Abstraction

B. Encapsulation

C. Polymorphism

D. Inheritance

Right Answer is: C

SOLUTION

Polymorphism, refers to the "many forms". Here different behaviour is the outcome of the changing situation.


Q. 189642 “When you are with your teacher, you behave like a student, when you are with your grandmother you behave like a child”  this illustrates the concept –


A. Abstraction

B. Polymorphism

C. Encapsulation

D. Inheritance

Right Answer is: B

SOLUTION

Same person changes its bevaviour in changing situation. It refers to the feature Polymorphism, i.e., mamy forms.


Q. 189643 “A car is a motor powered vehicle and a bicycle is a muscle powered vehicle”  this illustrates the concept –


A. Abstraction

B. Polymorphism

C. Encapsulation

D. Inheritance

Right Answer is: D

SOLUTION

Inheritance, car and bicycle both are vehicles, one powered by a motor and the other by human effort.


Q. 189644 ”In order to drive a car, we don’t have to know about the internal working of the parts”  this illustrates the  concept –


A. Abstraction

B. Polymorphism

C. Encapsulation

D. Data Hiding

Right Answer is: A

SOLUTION

Abstraction, does not include unnecessary details.


Q. 189645 The error in the following code is
         void func(char a, int n){    cout<< a<< 'a'<< n; } int func(char c, int n){    cout<< c<< n;    return 1; } void main() {  int t; char c;  t=2;c='+';  t=func(c,t);               func(c,t); }


A. There is no error

B. Function signatures are different

C. Function signatures are same

D. Function calls are not in the right order

Right Answer is: C

SOLUTION

The functions' signatures must be different, return type is not part of this.


Q. 189646 Give the output of the following code -
         void func(char a, int n){    cout<< a<< 'a'<< n; } int func(int n, char a,float f){    cout<< a<< n*f;    return 1; } void main() {  int t; char c; float f;  t=2; c='A';  f=13.5;  t=func(t,c,f);               func(c,t); }


A. A27Aa2

B. A27aA2

C. A27A2

D. A27Aa1

Right Answer is: D

SOLUTION

A27Aa1          Match the function calls with prototype, don’t miss that the t gets the value returned from funct( )


Q. 189647 Output of the following code will be -

     void func(){    cout<<"Look Out!"; } void func(char a, int n){    cout<< a<< n; } int func(int n, char a,float f){     cout<< a<< n<< f;     return 1; } void main() {  int t; char c; float f;  t=10;c='A'; f=23.5;  func(c,c);  t=func(t,c,f);  func(); }


A. A65 10 23.5 Look Out!

B. A65A1023.5Look Out!

C. 65 A 10 23.5Look Out!

D. A65 A 10 23Look Out!

Right Answer is: B

SOLUTION

A65A1023.5Look Out!   Match the function calls with prototype, also, ‘A’ as integer will show ASCII of A , which is 65


Q. 189648 The following definition will probably implement-
         class A{ private :                     int a;                     char b;                 public :                      virtual void display(){                        cout<<" in A ";                       }              };   i. Inheritance  ii. Dynamic Binding iii. Operator Overloading iv. Array of objects


A. i and ii

B. iii and iv

C. i and iv

D. ii and iii

Right Answer is: A

SOLUTION

i and ii, because of the presence of virtual function.


Q. 189649 Late binding is done


A. To link objects to data

B. At compile time

C. At run time

D. To bind data to functions

Right Answer is: C

SOLUTION

At run time, to link function call with the code to execute.


Q. 189650 Early binding is done


A. To link objects to data

B. At compile time

C. At run time

D. To bind data to functions

Right Answer is: B

SOLUTION

Early Binding is done at compile time, as compiler can match function call with function definition.


Q. 189651 Polymorphism is implemented through - 
i.    Operator Overloading
ii.   Function Overloading
iii.  Virtual Functions


A. i & ii

B. all of the above

C. none of the above

D. ii & iii

Right Answer is: B

SOLUTION

Polymorphism is the attribute that allows one interface to be used with different situation. C++ implements polymorphism through virtual functions, through overloaded functions and overloaded operators.


Q. 189652 Match the function call with the appropriate function – 
Function Call                                                Function Prototype
1) calcall(2);                                          i)   int calcall(char,int)
2) x=calcall(‘a’,10 );                            ii)  void calcall(int, int);
3) calcall(num1, num2 );                    iii) void calcall(int);  


A. 1 & i,  2 & ii,  3 & iii

B. 1 & ii,  2 &  iii, 3 & i

C. 1 & iii, 2 & i,  3 & ii

D. 1 &  iii,  2  &  ii,  3  &  i

Right Answer is: C

SOLUTION

1 & iii, 2 & i,  3 & ii  arguments in function call and prototype match.


Q. 189653 The feature given below,
          void func1(int dd, int mm, int yy);           float func1(int xy, float ty);              int func1(char nm[], int a);                      is


A. Operator overloading

B. Function overloading

C. Simple inheritance

D. Virtual functions

Right Answer is: B

SOLUTION

Function overloading, the same function has three different signatures and definitions.


Q. 189654 An abstract class is such that it can have


A. one instance.

B. one or two instances.

C. multiple instances.

D. zero instances.

Right Answer is: D

SOLUTION

Abstract classes cannot be instantiated. Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but does not contain any implementation.


Q. 189655 The program design method we use in order to write object-oriented programs is


A. declare-define-use.

B. public functions and private variables.

C. top down programming.

D. bottom up programming.

Right Answer is: D

SOLUTION

In bottom-up approach, the individual base elements of the system are first specified in great detail. These elements are then linked together to form larger subsystems. Object-oriented programming uses the concept of objects and classes.


Q. 189656 Error in the code " (k=0, k <10, k++) " is


A. semicolon should be used instead of commas.

B. there should be a semicolon at the end of the statement.

C. there is no error.

D. the increment should always be ++k.

Right Answer is: A

SOLUTION

In the for loop the proper syntax is for (initialization; condition; increment). So it should be for (k=0; k <10; k++).


Q. 189657 The error in the code: while (i <10) && (i >24) is that the


A. logical operator && cannot be used with while statement.

B. while loop is an exit condition loop.

C. test condition is always false.

D. test condition is always true.

Right Answer is: C

SOLUTION

Here the condition is always false, as i cannot be less than 10 and greater than 24 at the same time. Hence, it will never be true.


Q. 189658 The statement i--; is equivalent to 


A. i=i+1.

B. i=i-1.

C. i=i+i.

D. i=i+0.

Right Answer is: B

SOLUTION

-- is a decrement operator which decrements the value of a variable by 1. For example a-- is equal to a=a-1.


Q. 189659 The statement i++; is equivalent to 


A. i=i+1.

B. i=i-1.

C. i=i+i.

D. i=i+0.

Right Answer is: A

SOLUTION

++ is an increment operator which increments the value of a variable by 1.


Q. 189660 The looping process which checks the test condition at the end of the loop is


A. for loop.

B. while loop.

C. do while loop.

D. no looping process checks the condition at the end.

Right Answer is: C

SOLUTION

In the do while loop, code is executed at least once even if the condition is false.In this loop, the condition is evaluated at the end.


Q. 189661 Comments in C++ start with


A. //

B. {

C. ;

D. *

Right Answer is: A

SOLUTION

C++ supports two types of comments: // single line comment and /* */ Multiple line comment.


Q. 189662 Values can be output to variables in the program using the stream


A. cin.

B. cout.

C. input.

D. output.

Right Answer is: B

SOLUTION

Identifier cout corresponds to the output stream which represents data being displayed to the output screen.


Q. 189663 Values that can be input to variables in the program using the stream


A. cin.

B. cout.

C. input.

D. output.

Right Answer is: A

SOLUTION

cin corresponds to the standard input stream which represents data coming from the keyboard.


Q. 189664 Properties are inherited by


A. base class.

B. class.

C. derived class.

D. super class.

Right Answer is: C

SOLUTION

The derived class, which is also called a subclass, inherits the properties of a base class or super class.


Q. 189665 Private member function and data member ,


A. get accessed within the class.

B. get accessed outside the class.

C. get accessed within the main() funcion.

D. never accessed.

Right Answer is: A

SOLUTION

Private member function and data member can be accessed only within the class in which they are declared.


Q. 189666
A. || = .
B. ^= .
C. && =.
D. &=.

Right Answer is: B

SOLUTION

Bitwise operators are used to perform calculations using binary digits.


Q. 189667 If C is a subclass that inherits from the base classess, i.e., A and B. It refers to


A. single inheriance.

B. multi level inheriance.

C. hierarchical inheriance.

D. multiple inheriance.

Right Answer is: D

SOLUTION

When a subclass inherits from multiple base classes, it is known as multiple inheritance.


Q. 189668 Fundamental data types are of


A. 2 types.

B. 4 types.

C. 5 types.

D. 3 types.

Right Answer is: C

SOLUTION

There are 5 fundamental data types in C++ : char, int, float, double and void.


Q. 189669 A program always begin with function


A. enter ().

B. output ().

C. start ().

D. main ().

Right Answer is: D

SOLUTION

When a program begins running, the system calls the function main which marks the entry point of the program.


Q. 189670 At the lowest level, files are treated as a stream of


A. arrays.

B. bytes .

C. octal numbers.

D. hexadecimal numbers.

Right Answer is: B

SOLUTION

Information is stored as a "stream of bytes". Byte-stream files do not have a system-defined record structure.


Q. 189671 #(Hash) is directives for the


A. compiler.

B. editors.

C. interpreter.

D. preprocessor

Right Answer is: D

SOLUTION

# are preprocessor directives. They are typically used to make source programs easy to change and easy to compile in different execution environments.


Q. 189672 The assignment operator used in C++ programs


A. assigns l value to the r value (left to right rule).

B. assigns r value to the l value (right to left rule).

C. can be used in either way.

D. compares the two values.

Right Answer is: B

SOLUTION

The assignment operation always takes place from right to left and never the other way. Example, a=b, this statement assigns to variable a (the l value) the value contained in variable b (the r value).


Q. 189673 Unary operator used in C++  programs require


A. two operands.

B. no operand.

C. one operand.

D. any no of operands.

Right Answer is: C

SOLUTION

C++ provides two unary arithmetic operators - unary plus and unary minus. Unary operators operate on only one operand, which could be a constant or a variable.


Q. 189674 The programming technique, which focuses on an algorithm, is


A. procedural language.

B. object oriented language.

C. object based language.

D. structural language.

Right Answer is: A

SOLUTION

Procedural paradigm is a traditional programming that is based on the algorithms.


Q. 189675 The class, which inherits the properties of other class, is called as


A. derived class.

B. base class.

C. super class.

D. inheritable class.

Right Answer is: A

SOLUTION

The capability of one class to inherit the properties of other class is called as inheritance. The class which is inherited is called the base class or super class and the class which inherits from other class is derived class or sub class.


Q. 189676 The property by which the same message can be sent to objects of several classes is called


A. data abstraction.

B. polymorphism.

C. overloading.

D. inheritance.

Right Answer is: B

SOLUTION

Polymorphism is the ability for a message or data to be processed in more than one form.


Q. 189677 The process of creating an object is called


A. object creation.

B. object formation.

C. instantiation.

D. instant object.

Right Answer is: C

SOLUTION

An object is an instance of a class. It is the root of class hierarchy and the process of creating an object, is called as instantiation.


Q. 189678 The class, whose properties are inherited by other classes, is known as


A. derived class.

B. sub class.

C. super class.

D. inheritable class.

Right Answer is: C

SOLUTION

The capability of one class to inherit the properties of other class is called as inheritance. The class which is inherited is called the base class or super class and the class which inherits from other class is derived class or sub class.


Q. 189679 Argument matching in a function call is also known as


A. process of ambiguation.

B. process of disambiguation.

C. process of matching.

D. procedural ambiguity.

Right Answer is: B

SOLUTION

Argument matching involves comparing the actual arguments of the call with the formal parameters of each declared instance of the function. It removes ambiguity.


Q. 189680 A number of functions grouped and kept as a separate entity is called as


A. module.

B. abstraction.

C. polymorphism.

D. data.

Right Answer is: A

SOLUTION

A group of functions together forms a larger entity called module.


Q. 189681 Hiding intricate details from the end user, is


A. not an essential principal of system design.

B. a conventional programming approach.

C. same as data abstraction.

D. a way to implement data abstraction.

Right Answer is: D

SOLUTION

Encapsulation is wrapping up of data and functions into a single unit and it is a way to implement polymorphism.


Q. 189682 Procedural language paradigm gives more emphasis on


A. data rather than the work performed on it.

B. doing things rather than on data itself.

C. objects and classes.

D. principles of data hiding, abstraction and encapsulation.

Right Answer is: B

SOLUTION

Procedural programming aims at procedures. It is a list of instructions telling a computer, step by step, what to do, usually having a linear order of execution from the first statement to the second.


Q. 189683 The limitations of object based programming is removed by


A. procedural programming.

B. object oriented programming.

C. object function programming.

D. structural programming.

Right Answer is: B

SOLUTION

Object oriented programming offers all features of object based programming and removes the limitation by implementing inheritance and polymorphism as well.


Q. 189684 The limitation of object-based programming is


A. it’s inability to represent real world relationships.

B. that it overcomes shortcomings of procedural programming.

C. that it hides implementation details from users.

D. that it does not implement abstraction and information hiding.

Right Answer is: A

SOLUTION

Object based programming does not support inheritance. For example, both car and truck are vehicles, they cannot be represented in object-based programming.


Q. 189685 The compiler tries to find the best possible match for the function call.Matching process follows the sequence


A. by searching for exact match, a match through promotion, a match through standard conversion, a match through user defined conversion.

B. by searching for a match through promotion, a match through standard conversion, a match through user defined conversion.

C. by searching for exact match, a match through standard conversion, a match through user defined conversion.

D. by searching for exact match,then a match through promotion.

Right Answer is: A

SOLUTION

The sequence is by searching for exact match, a match through promotion, a match through standard conversion, a match through user defined conversion. A call to an overloaded function is resolved to a particular instance of the function through argument matching.


Q. 189686 The ability to reuse objects already defined, perhaps for a different purpose, with modification appropriate to the new purpose, is referred to as


A.  information hiding.

B. inheritance.

C. redefinition.

D. overloading.

Right Answer is: D

SOLUTION

A type of polymorphism, where different functions with the same name are invoked based on the data types of the parameters passed, is called overloading.


Q. 189687 A call to an overloaded function is resolved to a particular instance of the function through a process known as


A. call matching.

B. definition matching .

C. declaration matching.

D. argument matching.

Right Answer is: D

SOLUTION

Argument matching involves comparing the actual arguments of the call with the formal parameters of each declared instance of the function.


Q. 189688 A class that defines an interface but does not provide implementation details, is


A. class.

B. abstract class.

C. Base class.

D. Derived class.

Right Answer is: B

SOLUTION

An abstract class defined an interface but does not provide implementation details.


Q. 189689 When a function name is declared more than once in a program, and if the signatures of the two functions match exactly then


A. the second is treated as a re-declaration of first.

B. it is a compile time error.

C. it is a runtime error.

D. the second is treated as a different function.

Right Answer is: A

SOLUTION

Overloading is done on functions of same name, having different signatures. When a function has same number of arguments and same type of arguments in the same order, they are said to have the same signature.


Q. 189690 To introduce synonyms for existing types we use


A. data type.

B. typedef.

C. signified.

D. same name.

Right Answer is: B

SOLUTION

Typedef declarations do not define new types; they introduce synonyms for existing types. They do not affect the overloading mechanism.


Q. 189691 The process in which a function has several definitions which are differentiable by the number and types of their arguments is known as


A. function inheritance.

B. function overloading.

C. function overriding.

D. function polymorphism.

Right Answer is: B

SOLUTION

Function Overloading is a feature using which we can implement Polymorphism. In function overloading we can define more than one function of same name with different arguments. 


Q. 189692 The function used to specify the interface in abstract class but its implementation details are made available by concrete class is called as


A. virtual function.

B. overloaded function.

C. overloaded operator.

D. polymorphic function.

Right Answer is: A

SOLUTION

Virtual functions allow the programmer to declare functions in a base class that can be redefined in each derived class.


Q. 189693 The class, which defines an interface, but does not necessarily provide implementations for all its member functions, is called as


A. base class.

B. concrete class.

C. abstract class.

D. super class.

Right Answer is: C

SOLUTION

An abstract class is meant to be used as a base class from which other classes are derived.


Q. 189694 The ability to reuse the objects already defined, perhaps for a different purpose, with modification appropriate to the new purpose, is referred to as


A. information hiding.

B. inheritance.

C. redefinition.

D. overloading.

Right Answer is: D

SOLUTION

A type of polymorphism, where different functions with the same name are invoked based on the data types of the parameters passed, is called overloading.


Q. 189695 A call to an overloaded function is resolved to a particular instance of the function through a process known as


A. call matching.

B. definition matching .

C. declaration matching.

D. argument matching.

Right Answer is: D

SOLUTION

Argument matching involves comparing the actual arguments of the call with the formal parameters of each declared instance of the function.


Q. 189696 A concept related to the data abstraction is


A. Object and Classes.

B. Inheritance.

C. Data Hiding.

D. Polymorphism.

Right Answer is: C

SOLUTION

Data Hiding is a concept related to data abstraction. Unessential features or background details are hidden from the world.


Q. 189697 When a function name is declared more than once in a program, and if the signatures of the two functions match exactly then


A. the second is treated as a re-declaration of first.

B. it is a compile time error.

C. it is a runtime error.

D. the second is treated as a different function.

Right Answer is: A

SOLUTION

Overloading is done to create functions of same name with different signatures. When a function has same number of arguments and same type of arguments in the same order, they are said to have the same signature.


Q. 189698 When a function name is declared more than once in a program, and if the signatures of the two functions match exactly but the return types differ then


A. the second is treated as a re-declaration of first.

B. it is a compile time error.

C. it is a runtime error.

D. the second is treated as a different function.

Right Answer is: B

SOLUTION

The second function declaration is treated as as an erroneous re-declaration of the first function and is flagged at compile time as an error.


Q. 189699 The process in which a function has several definitions which can be distinguished by the number and types of their arguments is known as


A. function inheritance.

B. function overloading.

C. function overriding.

D. function polymorphism.

Right Answer is: B

SOLUTION

Overloaded functions have same name with different arguments.


Q. 189700 The function used to specify an interface in an abstract class, but its implementation details are made available by concrete class is called as


A. virtual function.

B. overloaded function.

C. overloaded operator.

D. polymorphic function.

Right Answer is: A

SOLUTION

Virtual functions allow the programmer to declare functions in a base class that can be redefined in each derived class.


PreviousNext