References

Q1:
Which of the following statement is correct about the program given below?
#include<iostream.h> 
class AptitudeCrack
{
    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()
{
    AptitudeCrack objAptitude;
    int x  = 2;
    int &y = x;
    y = 5;
    objAptitude.SetValue(x, ++y, x + y);
    objAptitude.Display();
    return 0; 
}

A It will result in a compile time error.

B The program will print the output 6 6 12.

C The program will print the output 6 6 10.

D The program will print the output 5 6 10.

ANS:B - The program will print the output 6 6 10.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.