logo

CuriousTab

CuriousTab

Discussion


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


  • Options
  • A. C++ allows static type checking.
  • B. C++ allows dynamic type checking.
  • C. C++ allows static member function be of type const.
  • D. Both A and B.

  • Correct Answer
  • Both A and B. 


  • More questions

    • 1. A union that has no constructor can be initialized with another union of __________ type.

    • Options
    • A. different
    • B. same
    • C. virtual
    • D. class
    • Discuss
    • 2. Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

    • Options
    • A. Preprocessor
    • B. Linker
    • C. Loader
    • D. Compiler
    • Discuss
    • 3. Which of the following statement is correct about the program given below?
      #include<iostream.h> 
      int main()
      {
          int arr[] = {1, 2 ,3, 4, 5}; 
          int &zarr = arr;
          for(int i = 0; i <= 4; i++)
          {
              arr[i] += arr[i];
          }
          for(i = 0; i <= 4; i++)
              cout<< zarr[i]; 
          return 0; 
      }

    • Options
    • A. The program will print the output 1 2 3 4 5.
    • B. The program will print the output 2 4 6 8 10.
    • C. The program will print the output 1 1 1 1 1.
    • D. It will result in a compile time error.
    • Discuss
    • 4. Which of the following is an invalid visibility label while inheriting a class?

    • Options
    • A. public
    • B. private
    • C. protected
    • D. friend
    • Discuss
    • 5. Which of the following statement is correct about the program given below?
      #include<iostream.h> 
      int main()
      {
          int x = 80; 
          int y& = x;
          x++;
          cout << x << " " << --y;
          return 0;
      }

    • Options
    • A. The program will print the output 80 80.
    • B. The program will print the output 81 80.
    • C. The program will print the output 81 81.
    • D. It will result in a compile time error.
    • Discuss
    • 6. Which of the following statement is correct about the program given below?
      #include<iostream.h> 
      class CuriousTab
      {
          int x, y; 
          public:
          void SetValue(int &xx, int &yy)
          {
              x =  xx ++;
              y =  yy; 
              Display();
          }
          void Display()
          {
              cout<< x << " " << y;
          }
      };
      int main()
      {
          int x = 10;
          int &y = x;
          CuriousTab objCuriousTab;
          objCuriousTab.SetValue(x , y);
          return 0; 
      }

    • Options
    • A. The program will print the output 10 10.
    • B. The program will print the output 10 11.
    • C. The program will print the output 11 11.
    • D. The program will print the output 11 10.
    • E. It will result in a compile time error.
    • Discuss
    • 7. What will be the output of the following program?
      #include<iostream.h>
      class CuriousTabBase
      {   
          public:
          CuriousTabBase()
          {
              cout<< "Base OK. "; 
          }
          ~CuriousTabBase()
          {
              cout<< "Base DEL. "; 
          }
      };
      class CuriousTabDerived: public CuriousTabBase
      {
          public:
          CuriousTabDerived()
          { 
              cout<< "Derived OK. "; 
          }
          ~CuriousTabDerived()
          { 
              cout<< "Derived DEL. "; 
          }
      };
      int main()
      {
          CuriousTabBase *basePtr = new CuriousTabDerived();
          delete basePtr;
          return 0;
      }

    • Options
    • A. Base OK. Derived OK.
    • B. Base OK. Derived OK. Base DEL.
    • C. Base OK. Derived OK. Derived DEL.
    • D. Base OK. Derived OK. Derived DEL. Base DEL.
    • E. Base OK. Derived OK. Base DEL. Derived DEL.
    • Discuss
    • 8. Which of the following is not a type of inheritance?

    • Options
    • A. Multiple
    • B. Multilevel
    • C. Distributive
    • D. Hierarchical
    • Discuss
    • 9. What will be the output of the following program?
      #include<iostream.h>
      class CuriousTabBase
      {   
          public:
          CuriousTabBase()
          {
              cout<< "Base OK. "; 
          }
      };
      class CuriousTabDerived: public CuriousTabBase
      {
          public:
          CuriousTabDerived()
          { 
              cout<< "Derived OK. "; 
          }
          ~CuriousTabDerived()
          { 
              cout<< "Derived DEL. "; 
          }
      };
      int main()
      {
          CuriousTabBase    objB;
          CuriousTabDerived objD;
          objD.~CuriousTabDerived();
          return 0;
      }

    • Options
    • A. Base OK. Derived OK. Derived DEL.
    • B. Base OK. Base OK. Derived OK. Derived DEL.
    • C. Base OK. Derived OK. Derived DEL. Derived DEL.
    • D. Base OK. Base OK. Derived OK. Derived DEL. Derived DEL.
    • E. The program will report compile time error.
    • Discuss
    • 10. Which of the following operators cannot be overloaded?

    • Options
    • A. []
    • B. ->
    • C. ?:
    • D. *
    • Discuss


    Comments

    There are no comments.

Enter a new Comment