OOP

32 Questions | Attempts: 136
Share

SettingsSettingsSettings
OOP - Quiz

.


Questions and Answers
  • 1. 

     How are the constants declared?

    • A.

      #include

    • B.

      #define preprocessor

    • C.

      CONSTANT CONSTANT=VALUE

    Correct Answer
    B. #define preprocessor
  • 2. 

    Which of the following will not return a value?

    • A.

      A) null

    • B.

      B) void

    • C.

      C) empty

    • D.

      D) free

    Correct Answer
    B. B) void
  • 3. 

    OOP stands for______________.

    • A.

      OBJECT ORIENTED PROGRAMMING

    • B.

      OBJECTIVE ORIENTED PROGRAMMING

    • C.

      OCTAL ORIENTED PROGRAMMING

    Correct Answer
    A. OBJECT ORIENTED PROGRAMMING
  • 4. 

    In C++, the _____________is a statement terminator. 

    • A.

      PLUS

    • B.

      SEMI-COLON

    • C.

      COLON

    • D.

      DOT

    Correct Answer
    B. SEMI-COLON
  • 5. 

    Which of the following statement is use to print something on the screen?

    • A.

      Cout

    • B.

      Count

    • C.

      Cin

    • D.

      Ccoutt

    Correct Answer
    A. Cout
  • 6. 

    Which of the following is not a keyword?

    • A.

      Auto

    • B.

      Goto

    • C.

      While

    • D.

      DO-THIS

    Correct Answer
    D. DO-THIS
  • 7. 

    Which of the following is not a data type ?

    • A.

      Long

    • B.

      Int

    • C.

      Double

    • D.

      Triple

    Correct Answer
    D. Triple
  • 8. 

    Which of the following data type returns value in True or False?

    • A.

      Boolean

    • B.

      Int

    • C.

      Short int

    • D.

      Unsigned int

    Correct Answer
    A. Boolean
  • 9. 

    Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the life-time of the program.

    • A.

      A. True

    • B.

      B. False

    Correct Answer
    A. A. True
  • 10. 

    \t is used to put_________.

    • A.

      Horizontal tab

    • B.

      Vertical tab

    • C.

      Carriage return

    • D.

      Enter

    Correct Answer
    A. Horizontal tab
  • 11. 

    Which of the following is not a type of operator?

    • A.

      Arithmetic

    • B.

      Logical

    • C.

      Friend

    • D.

      Bitwise

    Correct Answer
    C. Friend
  • 12. 

    C++ is a general-purpose _______________ programming language,

    • A.

      OBJCT ORIENTED

    • B.

      PROGRAM ORIENTED

    • C.

      CONCEPT ORIENTED

    • D.

      CLASS ORIENTED

    Correct Answer
    A. OBJCT ORIENTED
  • 13. 

    C++ supports single-line and multi-line comments.

    • A.

      A. True

    • B.

      B. False

    Correct Answer
    A. A. True
  • 14. 

    A class definition starts with the keyword class followed by the class name; and the class body, enclosed by a pair of curly braces. development of any software project regardless of their size or completely

    • A.

      A. True

    • B.

      B. False

    Correct Answer
    A. A. True
  • 15. 

    A class can be derived from more than one classes, which means it can inherit data and functions from multiple base classes, this is the concept of ________________________.

    • A.

      Inheritance

    • B.

      Polymorphism

    • C.

      Encapsulation

    • D.

      Friend constructor

    Correct Answer
    A. Inheritance
  • 16. 

    C++ _______________ handling is built upon three keywords: try, catch, and throw.

    • A.

      Exception

    • B.

      Class

    • C.

      Friend function

    • D.

      Constructor

    Correct Answer
    A. Exception
  • 17. 

    Execute a sequence of statements multiple times and abbreviates the code that manages the loop variable. This statement is true for which loop?

    • A.

      For

    • B.

      Do-while

    • C.

      While

    • D.

      Foreach

    Correct Answer
    A. For
  • 18. 

    #include using namespace std; double division(int a, int b) { if( b == 0 ) { throw "Division by zero condition!"; } return (a/b); } int main () { int x = 50; int y = 0; double z = 0; try { z = division(x, y); cout

    • A.

      Division by zero condition!

    • B.

      Compilation error

    • C.

      Zero (0)

    • D.

      A/b

    Correct Answer
    A. Division by zero condition!
  • 19. 

    IDE stands for _________.

    • A.

      Integrated development environment 

    • B.

      Integrate development environment 

    • C.

      Integral development environment 

    • D.

      Option 4

    Correct Answer
    A. Integrated development environment 
  • 20. 

    #include and #define are known as preprocessor directives 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 21. 

    Loader is use for linking different functions in the program

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 22. 

    Which of the following IDE is used for writing and executing C++ codes ?

    • A.

      Turbo C++

    • B.

      JDK

    • C.

      CLR 

    • D.

      Option 4

    Correct Answer
    A. Turbo C++
  • 23. 

    # is use to return address of the variable associated with it .

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 24. 

    Function that calls its self is called as__________.

    • A.

      Recursive function

    • B.

      Friend function 

    • C.

      Class function 

    • D.

      Option 4

    Correct Answer
    A. Recursive function
  • 25. 

    What is the output of the following program? #include<iostream> using namespace std; int x = 5; int &f() { return x; } main() { f() = 10; cout<<x; }

    • A.

      10

    • B.

      5

    • C.

      NO out put 

    • D.

      Option 4

    • E.

      Error 

    Correct Answer
    A. 10
  • 26. 

    Assigning one or more function body to the same name is called_______________

    • A.

      Function overloading 

    • B.

      Operator overloading 

    • C.

      Function hacking 

    • D.

      Function duplicating 

    Correct Answer
    A. Function overloading 
  • 27. 

    We can have nested try blocks in exception handling 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 28. 

    Cout>>hello world  is this statement is write?

    • A.

      Yes

    • B.

      No

    Correct Answer
    B. No
  • 29. 

    #include <iostream> int main() { cout << "Hello World!"; } output of this code is hello world

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
  • 30. 

    Which of the following returns some value?

    • A.

      Int

    • B.

      Void

    • C.

      Friend

    • D.

      Class

    Correct Answer
    A. Int
  • 31. 

    Cout is standard input stream and cin is standard output stream

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 32. 

    what is the output of this code? #include <iostream> using namespace std; int main () { int n = 10; while (n>0) { cout << n << ", "; --n; } }

    • A.

      10, 9, 8, 7, 6, 5, 4, 3, 2, 1

    • B.

      1 to 10

    • C.

      11 to 20

    • D.

      Even numbers between 1 to 10

    Correct Answer
    A. 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 23, 2019
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 12, 2019
    Quiz Created by
    Merina95varghese
Back to Top Back to top
Advertisement