31. Which of the following is a valid class declaration?
32. Which option is best to eliminate the memory problem?
33. Pick out the correct statement.
34. What do we need to use when we have multiple subscripts?
35. What will be the output of the following C++ code?
#include <iostream>
#include <complex>
using namespace std;
int main()
{
complex<double> c1(4.0, 16.0), c2;
c2 = pow(c1, 2.0);
cout << c2;
return 0;
}
#include <iostream>
#include <complex>
using namespace std;
int main()
{
complex<double> c1(4.0, 16.0), c2;
c2 = pow(c1, 2.0);
cout << c2;
return 0;
}36. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class S
{
int m;
public:
#define MAC(S::m)
};
int main(int argc, char const *argv[])
{
cout<<"Hello World";
return 0;
}
#include <iostream>
using namespace std;
class S
{
int m;
public:
#define MAC(S::m)
};
int main(int argc, char const *argv[])
{
cout<<"Hello World";
return 0;
}37. Which of the following operator cannot be used to overload when that function is declared as friend function?
38. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main ()
{
int a;
int * ptr_b;
int ** ptr_c;
a = 1;
ptr_b = &a;
ptr_c = &ptr_b;
cout << a << "\n";
cout << *ptr_b << "\n";
cout << *ptr_c << "\n";
cout << **ptr_c << "\n";
return 0;
}
#include <iostream>
using namespace std;
int main ()
{
int a;
int * ptr_b;
int ** ptr_c;
a = 1;
ptr_b = &a;
ptr_c = &ptr_b;
cout << a << "\n";
cout << *ptr_b << "\n";
cout << *ptr_c << "\n";
cout << **ptr_c << "\n";
return 0;
}39. In Linux, how do the heaps and stacks are managed?
40. Which of the following is not a function of complex values?
Read More Section(Classes and Objects in C plus plus)
Each Section contains maximum 100 MCQs question on Classes and Objects in C plus plus. To get more questions visit other sections.
