Quizzes
Take Quizzes
Animal
Nutrition
Love
Relationship
Computer
Sports
Society
Business
Geography
Language
Personality
Harry Potter
Movie
Television
Music
Online Exam
Health
Country
Art
Entertainment
Celebrity
Math
Game
Book
Fun
Science
Food
History
Education
All Topics
Create a Quiz
Quiz Maker
Training Maker
Survey Maker
Flashcards
Brain Games
See All
ProProfs.com
Search
Create A Quiz
Take Quizzes
Animal
Nutrition
Love
Relationship
Computer
Sports
Society
Business
Geography
Language
Personality
Harry Potter
Movie
Television
Music
Online Exam
Health
Country
Art
Entertainment
Celebrity
Math
Game
Book
Fun
Science
Food
History
Education
All Topics
Products
Quiz Maker
Training Maker
Survey Maker
Flashcards
Brain Games
See All
ProProfs.com
Quizzes
Quizzes
›
Computer
Ilp C++ Quiz Prelims 2
16 Questions
|
By Srikanth_kanthet | Updated: Mar 20, 2022
| Attempts: 39
Share
Start
Share on Facebook
Share on Twitter
Share on Whatsapp
Share on Pinterest
Share on Email
Copy to Clipboard
Embed on your website
Question
1
/ 17
🏆
Rank #--
▾
0 %
0/100
Score
0/100
1.
A class which can have only one instance at any time is called as ------------
Abstract
Singleton
Void class
None of the above
Submit
Start Quiz
About This Quiz
ILP C++ Quiz Prelims 2
2.
What first name or nickname would you like us to use?
You may optionally provide this to label your report, leaderboard, or certificate.
2.
Int main() { int a[20]={1,2,3}; cout<<a++; return 0; }
2
Address of a
Compilation error
Address of a+1
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;
5, 5, 6, 6
5, Garbage Value, 5, Garbage Value
5, 5, 5, Garbage value
Garbage Value, 5, 6, Garbage Value
Submit
4.
If you use same variable for two getline statements
Both the inputs are stored in that variable
The second input overwrites the first one
The second input attempt fails since the variable already got its value
You can not 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; }
ConstructorDestructorDestructor
ConstructorConstructorDestructor
ConstructorConstructorDestructorDestructor
ConstructorDestructorConstructorDestructor
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; }
2 1
Error
1 2
No output
Submit
7.
The base class of runtime_error is __________
Runtime class
Exception_handler class
Exception class
Virtual base class
Submit
8.
int main() { char s[]="welcome", *p=s; cout<<p+p[1]-p[3]; return 0; }
Welcome
Come
Error
Lcome
Submit
9.
Int main() { int n1=10,n2=2,k,*p1,*p2; p1=&n1,p2=&n2; k=*p1/*p2; cout<<k; return 0; }
5
Error
Division cannot be done over pointers
10
Submit
10.
Which function helps to extract the string "is left" from the string "23.5 is left"
Atof()
Strtod()
Atod()
None
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(); }
Object m1 is of type myclass
Object m1 is of type mybase
Object m1 is of type P6mybase
Object m1 is of type P6myclass
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; }
Compilation Error
No Ouput
Param Constructor
None of the above
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);}
Error
10 20
No output
None of the above
Submit
14.
The size of following variable is not 4 bytes in 32 bit systems
Int
Long int
Short int
Float
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?
&word
Static_cast(word)
*(&word)
Static_cast(word)
Submit
×
Thank you for your feedback!
View My Results
Related Quizzes
Tablet Quiz: What Tablet Should I Buy Quiz
Tablet Quiz: What Tablet Should I Buy Quiz
Thank you for your feedback!
Would you like to edit this question to improve it?
No thanks
Name:
Email:
Oops! Give us more information:
Incorrect Question
Incorrect Answer
Typos
I have a feedback
Submit
Please provide name and email to proceed.
Please provide correct email to proceed.
Please provide feedback.
Please select the option.
All (16)
Unanswered (
)
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...
X
OK
X
OK
Cancel
X
OK
Cancel
Your Rank: #-- / --
Leaderboard
✕