adplus-dvertising
frame-decoration

Question

Which of the following statement is correct about the program given below?
#include<iostream.h> 
static int Result;
class CompSci
{
    public:
    void Change(int x = 10, int y = 20, int z = 30)
    {
        cout<< x + y + z;
    }
    void Display(int x = 40, float y = 50.00)
    {
        Result = x % x; 
        cout<< Result;
    }
};
class Bits
{
    int x, y; 
    public:
    void Change(int x, int y = 50)
    {
        cout<< x + y;
    }
};
class Compscibits: public CompSci, public Bits
{
    public:
    void Display(int x = 10, int xx = 100, int xxx = 1000)
    {
        Result = x + xx % x * x;
        cout<< Result ; 
    }
};
int main()
{
    Compscibits objBits;
    objBits.CompSci::Display(10, 20.00);
    return 0; 
}#include<iostream.h> 
class Compscibits
{
    int x; 
    float y; 
    public:
    void BitsFunction(int = 0, float = 0.00f, char = 'A');
    void BitsFunction(float, int = 10.00, char = 'Z');
    void BitsFunction(char, char, char);
};
int main()
{
    Compscibits objBits;
    objBits.BitsFunction(10 * 1.0, int(56.0)); 
    return 0;
}
void Compscibits::BitsFunction(int xx, float yy, char zz)
{
    x = xx + int(yy);
    cout<< "x = " << x << endl;
}
void Compscibits::BitsFunction(float xx, int yy, char zz)
{
    x = zz + zz;
    y = xx + yy;
    cout<< " x = " << x << endl;
}
void Compscibits::BitsFunction(char xx, char yy, char zz)
{
    x = xx + yy + zz; 
    y = float(xx * 2); 
    cout<< " x = " << x << endl;
}

a.

The program will print the output x = 65.

b.

The program will print the output x = 66.

c.

The program will print the output x = 130.

d.

The program will print the output x = 180.

Answer: (d).The program will print the output x = 180.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following statement is correct about the program given below?

Similar Questions

Discover Related MCQs

Q. The variable that are listed in the function's calls are called

Q. A programmer can create custom header files that must be end with

Q. Unary scope resolution operator is denoted by

Q. To make large programs more manageable programmers modularize them into subprograms that are called

Q. The maths function acos (x) stands for

Q. Which from the following is not a storage class specifier in C++?

Q. Which of the following function returns no value?

Q. A variable that is declared inside a block is called

Q. For accessing a global variable when a local variable of the same name is in scope, C++ provides a

Q. The () parenthesis in a function call

Q. Modules in C++ are called

Q. Which from the following is used for invoking a function?

Q. There are how many ways to invoke a function in C++?

Q. All variables declared in function definition are called

Q. Which operator is used for accessing global variables if the local variable of same name exists in the code?

Q. A function that need no return value, is called

Q. An identifier's scope is

Q. The standard C library file < stdlib.h> is used for

Q. Not initializing a reference variable will cause

Q. In which circumstances the recursion function is called?