C++ multiple choice and objective type questions with answers and explanations.
1) 3.4E - 38 is equivalent to ?
1) 3.4E - 38 is equivalent to ?
- 3.4 x 10 x 38
- 3.4 x 38
- 3.4 x 10-38
- None of these
Show/Hide Answer
Answer = C
Explanation:No Explanation
2) A floating point number contains......? Explanation:No Explanation
- Both integral and fractional part
- Fractional part only
- Integral part only
- 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 ?Explanation: Floating point constants can have any sign +ve or -ve and can be
- Type Less language
- Statically types Language
- Dynamically typed language
- 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 ? 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.
- abstract
- dynamic
- virtual
- 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++ ? Explanation: virtual indicates that the virtual method will be resolved at runtime i.e the method resolution is dynamic.
- Operator overloading
- Namespaces
- Inheritance
- 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 ? Explanation:Reflection requires runtime suppott, which is not available in C++, because it is a native language.
- Simple Template Library
- Static Template Library
- Single Type Based Library
- 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 ? Explanation: No Explanation
- self pointer
- std::auto_ptr pointer
- myself pointer
- 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 ? Explanation: No Explanation
- X(const X* arg)
- X( const X& arg)
- X(X arg)
- 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 ? Explanation: The copy constructor takes a const reference to the class type as the argument.
- Scope resolution operator
- Arrow operator
- Equality operator
- 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 ? Explanation: All the three operators can be overloaded except ::(scope resolution operator).
- By declaring the class as interface with keyword interface
- By making all the methods abstract using the keyword abstract in class
- By making all the methods pure virtual in class
- 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
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