Sail E0 Webinar
Question


What is correct about the following program?


#include
class Addition
{
int x;
public:
Addition()
{
x = 0;
}
Addition(int xx)
{
x = xx;
}
Addition operator + (int xx = 0)
{
Addition objTemp;
objTemp.x = x + xx;
return(objTemp);
}
void Display(void)
{
cout
Options:
A .  The program will print the output 20.
B .  The program will report run time error.
C .  The program will print the garbage value.
D .  Compilation fails due to 'operator +' cannot have default arguments.
Answer: Option D



Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

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

More Questions on This Topic :


Latest Videos

Latest Test Papers