Functions

Q1: What will be the output of the following program?
#include<iostream.h> 
class AptitudeCrack
{
    int x, y, z; 
    public:
    void Apply(int xx = 12, int yy = 21, int zz = 9)
    {
        x = xx;
        y = yy += 10;
        z = x -= 2;
    }
    void Display(void)
    {
        cout<< x << ' ' << y << endl; 
    } 
    void SetValue(int xx, int yy)
    {
        Apply(xx, 0, yy);
    }
};
int main()
{
    AptitudeCrack *pAptitude= new AptitudeCrack;
   (*pAptitude).SetValue(12, 20);
    pAptitude->Display();
    delete pAptitude;
    return 0; 
}

A 12 10

B 12 21

C 12 31

D 10 10

E The program will report compilation error.

ANS:A - 10 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.