logo

CuriousTab

CuriousTab

Discussion


Home C++ Programming References See What Others Are Saying!
  • Question
  • Which of the following statement is correct?


  • Options
  • A. A reference is stored on heap.
  • B. A reference is stored on stack.
  • C. A reference is stored in a queue.
  • D. A reference is stored in a binary tree.

  • Correct Answer
  • A reference is stored on stack. 


  • More questions

    • 1. Which of the following concepts provides facility of using object of one class inside another class?

    • Options
    • A. Encapsulation
    • B. Abstraction
    • C. Composition
    • D. Inheritance
    • Discuss
    • 2. Which of the following concepts means wrapping up of data and functions together?

    • Options
    • A. Abstraction
    • B. Encapsulation
    • C. Inheritance
    • D. Polymorphism
    • Discuss
    • 3. Which of the following statement is correct about the program given below?
      #include<iostream.h> 
      struct Tab
      {
          short n;
      };
      int main()
      {
          Tab b;
          Tab& rb = b;
          b.n = 5;
          cout << b.n << " " << rb.n << " ";
          rb.n = 8;
          cout << b.n << " " << rb.n;
          return 0; 
      }

    • Options
    • A. It will result in a compile time error.
    • B. The program will print the output 5 5 5 8.
    • C. The program will print the output 5 5 8 8.
    • D. The program will print the output 5 5 5 5.
    • Discuss
    • 4. What will be the output of the following program?
      #include<iostream.h>
      long CuriousTabFunction(int x, int y = 5, float z = 5)
      {
          return(++x * ++y + (int)++z);
      }
      int main()
      {
          cout<< CuriousTabFunction(20, 10); 
          return 0;
      }

    • Options
    • A. 237
    • B. 242
    • C. 240
    • D. 35
    • E. The program will report error on compilation.
    • Discuss
    • 5. Which of the following means "The use of an object of one class in definition of another class"?

    • Options
    • A. Encapsulation
    • B. Inheritance
    • C. Composition
    • D. Abstraction
    • Discuss
    • 6. Which of the following statement is correct?

    • Options
    • A. Destructor destroys only integer data members of the object.
    • B. Destructor destroys only float data members of the object.
    • C. Destructor destroys only pointer data members of the object.
    • D. Destructor destroys the complete object.
    • Discuss
    • 7. Which of the following statements are correct?

    • Options
    • A. Constructor is always called explicitly.
    • B. Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
    • C. Destructor is always called explicitly.
    • D. Constructor and destructor functions are not called at all as they are always inline.
    • Discuss
    • 8. What will be the output of the following program?
      #include<iostream.h> 
      void MyFunction(int a, int b = 40)
      {
          cout<< " a = "<< a << " b = " << b << endl;
      }
      int main()
      {
          MyFunction(20, 30);
          return 0; 
      }

    • Options
    • A. a = 20 b = 40
    • B. a = 20 b = 30
    • C. a = 20 b = Garbage
    • D. a = Garbage b = 40
    • Discuss
    • 9. Which of the following is correct about function overloading?

    • Options
    • A. The types of arguments are different.
    • B. The order of argument is different.
    • C. The number of argument is same.
    • D. Both A and B.
    • Discuss
    • 10. Which of the following statement is correct about the program given below?
      #include<iostream.h>
      long GetNumber(long int Number)
      {
          return --Number;
      }
      float GetNumber(int Number)
      {
          return ++Number;
      }
      int main()
      {
          int x = 20;
          int y = 30;
          cout<< GetNumber(x) << " ";
          cout<< GetNumber(y) ;
          return 0; 
      }

    • Options
    • A. The program will print the output 19 31.
    • B. The program will print the output 20 30.
    • C. The program will print the output 21 31.
    • D. The program will print the output 21 29.
    • E. Program will report compile time error.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment