C++ Programming MCQ Practice Test - Set 01 - ObjectiveBooks

C++ Programming MCQ Practice Test - Set 01

Practice Test: Question Set - 01


1. Which of the following is not a valid conditional inclusion in preprocessor directives?
    (A) #ifdef
    (B) #ifundef
    (C) #endif
    (D) #elif

2. Which one of the following is not a fundamental data type in C++
    (A) float
    (B) string
    (C) int
    (D) wchar_t

3. Which of the following correctly describes C++ language?
    (A) Statically typed language
    (B) Dynamically typed language
    (C) Both Statically and dynamically typed language
    (D) Type-less language

4. Which of the following is the most preferred way of throwing and handling exceptions?
    (A) Throw by value and catch by reference
    (B) Throw by reference and catch by reference
    (C) Throw by value and catch by value
    (D) Throw the pointer value and provide catch for the pointer type

5. What is the implicit pointer that is passed as the first argument for non-static member functions?
    (A) ‘self’ pointer
    (B) std::auto_ptr pointer
    (C) ‘Myself’ pointer
    (D) ‘this’ pointer

6. Which of the following is not true about preprocessor directives?
    (A) They begin with a hash symbol
    (B) They are processed by a preprocessor
    (C) They form an integral part of the code
    (D) They have to end with a semi colon

7. A continue statement causes execution to skip to
    (A) The return 0; statement
    (B) The first statement after the loop
    (C) The statement following the continue statement
    (D) The next iteration of the loop

8. Which classes allow primitive types to be accessed as objects?
    (A) Storage
    (B) Virtual
    (C) Friend
    (D) Wrapper

9. What’s wrong? for (int k = 2, k <=12, k++)
    (A) The increment should always be ++k
    (B) The variable must always be the letter i when using a for loop
    (C) There should be a semicolon at the end of the statement
    (D) The commas should be semicolons

10. Which of the following is a valid destructor of the class name “Country”
    (A) int ~Country()
    (B) void Country()
    (C) int ~Country(Country obj)
    (D) void ~Country()

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests: