Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class three_d
4.
{
5.
int x, y, z;
6.
public:
7.
three_d() { x = y = z = 0; }
8.
three_d(int i, int j, int k) { x = i; y = j; z = k; }
9.
three_d operator()(three_d obj);
10.
three_d operator()(int a, int b, int c);
11.
friend ostream &operator
Options:
A .  55, 106, 156
B .  55, 106
C .  55, 106, 159
D .  none of the mentioned
Answer: Option A

In this program, We are using the function call operator to calculate the value of objc.
Output:
$ g++ call2.cpp
$ a.out
55, 106, 156



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers