C++ Programming - Functions - Discussion

Discussion Forum : Functions - Programs (Q.No. 42)
42.
Which of the following statement is correct about the program given below?
#include<iostream.h> 
class IndiaBix
{
    int x; 
    float y; 
    public:
    void BixFunction(int = 0, float = 0.00f, char = 'A');
    void BixFunction(float, int = 10.00, char = 'Z');
    void BixFunction(char, char, char);
};
int main()
{
    IndiaBix objBix;
    objBix.BixFunction(10 * 1.0, int(56.0)); 
    return 0;
}
void IndiaBix::BixFunction(int xx, float yy, char zz)
{
    x = xx + int(yy);
    cout<< "x = " << x << endl;
}
void IndiaBix::BixFunction(float xx, int yy, char zz)
{
    x = zz + zz;
    y = xx + yy;
    cout<< " x = " << x << endl;
}
void IndiaBix::BixFunction(char xx, char yy, char zz)
{
    x = xx + yy + zz; 
    y = float(xx * 2); 
    cout<< " x = " << x << endl;
}
The program will print the output x = 65.
The program will print the output x = 66.
The program will print the output x = 130.
The program will print the output x = 180.
The program will not compile successfully.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
3 comments Page 1 of 1.

Anurag sharma said:   6 years ago
Hello @All.

The answer is 180 bcoz the asci value of Z is 90 so,
x=zz + zz it means x= 90 + 90= 180.

Ujwal said:   8 years ago
How zz value is 90? it should be 97.

Phong said:   1 decade ago
x = zz + zz = 90 + 90 = 180.

Post your comments here:

Your comments will be displayed after verification.