logo

CuriousTab

CuriousTab

Discussion


Home C++ Programming OOPS Concepts See What Others Are Saying!
  • Question
  • Which of the following statements regarding inline functions is correct?


  • Options
  • A. It speeds up execution.
  • B. It slows down execution.
  • C. It increases the code size.
  • D. Both A and C.

  • Correct Answer
  • Both A and C. 


  • More questions

    • 1. Which of the following concepts of OOPS means exposing only necessary information to client?

    • Options
    • A. Encapsulation
    • B. Abstraction
    • C. Data hiding
    • D. Data binding
    • Discuss
    • 2. What does the class definitions in following code represent?
      class Bike
      {
          Engine objEng;
      };
      class Engine
      {
          float CC;
      };

    • Options
    • A. kind of relationship
    • B. has a relationship
    • C. Inheritance
    • D. Both A and B
    • Discuss
    • 3. A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

    • Options
    • A. constructor
    • B. destructor
    • C. function
    • D. object
    • Discuss
    • 4. How many objects can be created from an abstract class?

    • Options
    • A. Zero
    • B. One
    • C. Two
    • D. As many as we want
    • Discuss
    • 5. Which of the following statement is correct?

    • Options
    • A. Constructor has the same name as that of the class.
    • B. Destructor has the same name as that of the class with a tilde symbol at the beginning.
    • C. Both A and B.
    • D. Destructor has the same name as the first member function of the class.
    • Discuss
    • 6. Which of the following statements is correct?

      1. A reference is not a constant pointer.
      2. A referenced is automatically de-referenced.

    • Options
    • A. Only 1 is correct.
    • B. Only 2 is correct.
    • C. Both 1 and 2 are correct.
    • D. Both 1 and 2 are incorrect.
    • Discuss
    • 7. Which of the following provides a reuse mechanism?

    • Options
    • A. Abstraction
    • B. Inheritance
    • C. Dynamic binding
    • D. Encapsulation
    • Discuss
    • 8. What will be the output of the following program?
      #include<iostream.h> 
      class Tab
      {
          public:
            int x;
      };
      int main()
      {
          Tab *p = new Tab();
      
          (*p).x = 10;
          cout<< (*p).x << " " << p->x << " " ;
      
          p->x = 20;
          cout<< (*p).x << " " << p->x ;
      
          return 0;
      }

    • Options
    • A. 10 10 20 20
    • B. Garbage garbage 20 20
    • C. 10 10 Garbage garbage
    • D. Garbage garbage Garbage garbage
    • Discuss
    • 9. A destructor takes __________ arguments.

    • Options
    • A. one
    • B. two
    • C. three
    • D. no
    • Discuss
    • 10. What will be the output of the following program?
      #include<iostream.h> 
      class CuriousTabSample
      {
          public:
              int   a; 
              float b;
              void CuriousTabFunction(int a, float b, float c = 100.0f)
              {
                  cout<< a % 20 + c * --b;
              } 
      }; 
      int main()
      {   CuriousTabSample objCuriousTab;
          objCuriousTab.CuriousTabFunction(20, 2.000000f, 5.0f);
          return 0; 
      }

    • Options
    • A. 0
    • B. 5
    • C. 100
    • D. -5
    • E. None of these
    • Discuss


    Comments

    There are no comments.

Enter a new Comment