Ilp C++ Quiz Prelims 2

16 Questions | Attempts: 39
Share
Please wait...
Question 1 / 16
0 %
0/100
Score 0/100
1. A class which can have only one instance at any time is called as ------------
Submit
Please wait...
About This Quiz
C Programming Quizzes & Trivia

ILP C++ Quiz Prelims 2

Personalize your quiz and earn a certificate with your name on it!
2. Int main() {   int a[20]={1,2,3};   cout<<a++;   return 0;   }
Submit
3. What is the output of the follwing code                 int a=5,*p=&a;                *p++;                  cout<<a<<"\t"<<*p<<endl;                 *++p;                  cout<<a<<"\t"<<*p<<endl;  
Submit
4. If you use same variable for two getline statements
Submit
5. Class ConstructTest         {                 public:                 ConstructTest()   {     cout<<"Constructor";     }                 ~ConstructTest()  {    cout<<"Destructor";       }    };         int main()      {                 ConstructTest c[2];                 return 0;         }
Submit
6. What is the output of the following code snippet ? class VirtualClass         {                            int x,y;                 public:                 VirtualClass()   {                         x=1,y=2;           }                 virtual void operator<<(ostream&);       }; //end of class void VirtualClass::operator<<(ostream &os)        {                 os<<this->x<<"\t"<<this->y;         } int main()         {                 VirtualClass vcObj;                 vcObj<<cout;                 return 0;    }
Submit
7. The base class of runtime_error is __________
Submit
8.     int main()     {       char s[]="welcome", *p=s;       cout<<p+p[1]-p[3];       return 0;      }
Submit
9. Int main() {   int n1=10,n2=2,k,*p1,*p2;   p1=&n1,p2=&n2;   k=*p1/*p2;   cout<<k;   return 0;  }
Submit
10. Which function helps to extract the string "is left" from the string "23.5 is left"
Submit
11. Class mybase{   }; class myclass : public mybase{ }; myclass m1; int main()   {   mybase *b1 = new myclass();   cout << "object m1 is of type " << typeid(b1).name(); }
Submit
12. What is the output of the following code snippet ?   class Test { public: Test(int x) { cout<<"Param Construcor"; }  }; //end of class int main() { Test t1=100; return 0;   }
Submit
13.  What is the output of the below code ? class Alpha { public: Alpha(int a=10,int b) {cout<<a<<"\t"<<b;} }; int main() { Alpha x(10,20);}
Submit
14. The size of following variable is not 4 bytes in 32 bit systems
Submit
15. Which of the header file must be included to use stringstream?
Submit
16. Consider the below statement          char *word="tcs";          How do you get the address that is stored in the char* variable?
Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2022 +

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

  • Current Version
  • Mar 20, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Sep 12, 2012
    Quiz Created by
    Srikanth_kanthet
Cancel
  • All
    All (16)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
A class which can have only one instance at any time is called as...
Int main()...
What is the output of the follwing code...
If you use same variable for two getline statements
Class ConstructTest         {...
What is the output of the following code snippet ?...
The base class of runtime_error is __________
    int main()...
Int main()...
Which function helps to extract the string "is left" from...
Class mybase{  ...
What is the output of the following code snippet ?...
 What is the output of the below code ?...
The size of following variable is not 4 bytes in 32 bit systems
Which of the header file must be included to use stringstream?
Consider the below statement...
Alert!

Advertisement