Which of the following statement is correct about the program given below? #include<iostream.h> class IndiaBix { int a, b, c; public: void SetValue(int x, int y ,int z) { a = x; b = y; c = z; } void Display() { cout<< a << " " << b << " " << c; } }; int main() { IndiaBix objBix; int x = 2; int &y = x; y = 5; objBix.SetValue(x, ++y, x + y); objBix.Display(); return 0; }

Question:
Which of the following statement is correct about the program given below?

#include<iostream.h> 
class IndiaBix
{
    int a, b, c; 
    public:
    void SetValue(int x, int y ,int z)
    {
        a = x;
        b = y;
        c = z;
    } 
    void Display()
    {
        cout<< a << " " << b << " " << c;
    } 
}; 
int main()
{
    IndiaBix objBix;
    int x  = 2;
    int &y = x;
    y = 5;
    objBix.SetValue(x, ++y, x + y);
    objBix.Display();
    return 0; 
}

1.The program will print the output 5 6 10.

2.The program will print the output 6 6 10.

3.The program will print the output 6 6 12.

4.It will result in a compile time error.

Posted Date:-2021-02-24 09:30:50


More MCQS Questions and answers

Search
Olete Team
Online Exam Test Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Test website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!