C/C++ Programming Language - Set 2

10 Questions | Total Attempts: 6074

SettingsSettingsSettings
Please wait...
C/C++ Programming Language - Set 2

Online MCQ Quiz on C/C++ Programming - Set 2 No. Of Questions:- 10 Time:- 10 Minutes Full Mark:- 100 Pass Mark:- 70 This Quiz is for those user who wants to test their knowledge/skill in C/C++ Programming Language. For more MCQ Questions and Online Quizzes please visit https://www. McqQuestions. Com


Questions and Answers
  • 1. 
    A constructor is called whenever
    • A. 

      A object is declared

    • B. 

      An object is used

    • C. 

      A class is declared

    • D. 

      A class is used

  • 2. 
    Overload function in C++
    • A. 

      A group function with the same name

    • B. 

      All have the same number and type of arguments

    • C. 

      Functions with same name and same number and type of arguments

    • D. 

      All

  • 3. 
    Operator overloading is 
    • A. 

      Making C++ operators works with objects

    • B. 

      Giving new meaning to existing C++ operators

    • C. 

      Making new C++ operator

    • D. 

      Making C++ operators works with objects and giving new meaning to existing C++ operators

  • 4. 
    A constructor is called whenever
    • A. 

      A object is declared

    • B. 

      An object is used

    • C. 

      A class is declared

    • D. 

      A class is used

  • 5. 
    A class having no name
    • A. 

      Is not allowed

    • B. 

      Can’t have a constructor

    • C. 

      Can’t have a destructor

    • D. 

      Can’t be passed as an argument

  • 6. 
    The differences between constructors and destructor are
    • A. 

      Constructors can take arguments but destructor can’t

    • B. 

      Constructors can be overloaded but destructors can’t be overloaded

    • C. 

      Both

    • D. 

      None of these

  • 7. 
    A destructor takes
    • A. 

      One argument

    • B. 

      Two arguments

    • C. 

      Three arguments

    • D. 

      Zero arguments

  • 8. 
    Constructors are used to
    • A. 

      Initialize the objects

    • B. 

      Construct the data members

    • C. 

      Both

    • D. 

      None of These

  • 9. 
    In C++ a function contained within a class is called
    • A. 

      A member function

    • B. 

      An operator

    • C. 

      A class function

    • D. 

      A method

  • 10. 
    The fields in a class of a C++ program are by default
    • A. 

      Protected

    • B. 

      Public

    • C. 

      Private

    • D. 

      None of these