Sail E0 Webinar
Question



1.
#include
2.
using namespace std;
3.
class Integer
4.
{
5.
int i;
.
public:
7.
Integer(int ii) : i(ii) {}
8.
const Integer
9.
operator+(const Integer& rv) const
10.
{
11.
cout
Options:
A .  10 10
B .  11 11
C .  error
D .  runtime error
Answer: Option A

Answer: (a)
Explanation:We are using two operator functions and executing them and result is printed according to the order.
Output:
$ g++ oper2.cpp
$ a.out
operator+
operator+=



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers