Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Type atleast 3 characters
Popular Searches
Trending Pages
Notifications Mark All Read
No New notification
Capgemini Menu9>
PREPINSTA PRIME
Get Hiring Updates right in your inbox from PrepInsta
Question 1
#include <bits/stdc++.h> using namespace std; class A{ int a; public: A(int i){ a = i; } void assign(int i){ a = i; } int return_value(){ return a; } }; int main(int argc, char const *argv[]) { A obj; obj.assign(5); cout<<obj.return_value(); }
5
55
Error
Segmentation fault
Garbage value
Start
Question 2
#include <iostream> #include <string> using namespace std; class A{ int a; public: A(){ cout<<"A's constructor called"; } }; class B{ static A a; public: B(){ cout<<"B's constructor called"; } static A get(){ return a; } }; A B::a; int main(int argc, char const *argv[]) { B b; A a1 = b.get(); A a2 = b.get(); A a3 = b.get(); }
3
2
4
1
None of these
Question 3
Zero(0)
None of the mentioned
Question 4
Error occurs
Objects are not created properly
Compiler provides a default constructor to avoid faults/errors
Question 5
Question 6
->
:
.
::
Question 7
It is used to provide multiple inheritances.
It is used to avoid multiple copies of the base class in derived class.
It is used to allow multiple copies of the base class in a derived class.
It allows private members of the base class to be inherited in the derived class.
Question 8
copy constructor
default constructor
Both A and B
Question 9
A destructor has the same name as the class in which it is present.
A destructor has a different name than the class in which it is present.
A destructor always returns an integer.
A destructor can be overloaded.
Question 10
Compile-time error.
Preprocessing error.
Runtime error.
Runtime exception.
Please login to report
Buy Capgemini Pseudo Code Paid Materials
Join Capgemini Online Classes