C++ Multiple Choice Questions And Answers - Set 2

C++ multiple choice and objective type questions with answers and explanations.

1) 3.4E - 38 is equivalent to ?
  1. 3.4 x 10 x 38
  2. 3.4 x 38
  3. 3.4 x 10-38
  4. None of these
Show/Hide Answer
Answer = C 
Explanation:No Explanation
2) A floating point number contains......?
  1. Both integral and fractional part
  2. Fractional part only
  3. Integral part only
  4. None of these
Show/Hide Answer
Answer = A
Explanation: Floating point constants can have any sign +ve or -ve and can be
3) Which statement is most appropriate for C++ language ?
  1. Type Less language
  2. Statically types Language
  3. Dynamically typed language
  4. Both B and C
Show/Hide Answer
Answer = B
Explanation:
It is statically types language because all the types and type related information in the program are statically resolved by the compiler at compile time.
4)Keyword used for Dynamic method resolution ?
  1. abstract
  2. dynamic
  3. virtual
  4. typeid
Show/Hide Answer
Answer = C
Explanation:
virtual indicates that the virtual method will be resolved at runtime i.e the method resolution is dynamic.
5) Which of the following is not a feature of C++ ?
  1. Operator overloading
  2. Namespaces
  3. Inheritance
  4. Reflection
Show/Hide Answer
Answer = D
Explanation:
Reflection requires runtime suppott, which is not available in C++, because it is a native language.
6) The term STL stands for ?
  1. Simple Template Library
  2. Static Template Library
  3. Single Type Based Library
  4. Standard Template Library
Show/Hide Answer
Answer = D
Explanation:
No Explanation
7) What is the implicit pointer that is passed as the first argument for nonstatic member functions ?
  1. self pointer
  2. std::auto_ptr pointer
  3. myself pointer
  4. this pointer
Show/Hide Answer
Answer = D 
Explanation: No Explanation
8) What is the right way to declare a copy constructor of a class if the name of class is X ?
  1. X(const X* arg)
  2. X( const X& arg)
  3. X(X arg)
  4. X(X* arg)
Show/Hide Answer
Answer = B
Explanation:
The copy constructor takes a const reference to the class type as the argument.
9) Which of the following operator can not be overloaded ?
  1. Scope resolution operator
  2. Arrow operator
  3. Equality operator
  4. Assignment operator
Show/Hide Answer
Answer = A
Explanation:
All the three operators can be overloaded except ::(scope resolution operator).
10) How do we declare an interface class ?
  1. By declaring the class as interface with keyword interface
  2. By making all the methods abstract using the keyword abstract in class
  3. By making all the methods pure virtual in class
  4. It is not possible to create interface classes in c++
Show/Hide Answer
Answer = C
Explanation:
C++ does not support interface classes directly as in java


Do You Like This? Please take 5 seconds to share with your firends.

1 comments:

nice ques.........

Post a Comment