Cpp Programming Quiz 237 – What will be the out of the following program?
[A].
11 22 0 0
[B].
11 0 0 22
[C].
11 0 22 0
[D].
11 22 11 22
Answer: Option C
Explanation:
No answer description available for this question.
11 0 0 22
[C].
11 0 22 0
[D].
11 22 11 22
Answer: Option C
Explanation:
No answer description available for this question.
#include
#include
class IndiaBix
{
    char txtMsg[50];
    public:
    IndiaBix(char *str = NULL)
    {
    if(str != NULL)
       strcpy(txtMsg, str);
    }
    int BixFunction(char ch);
};
int IndiaBix::BixFunction(char ch)
{
    static int i = 0;
    if(txtMsg[i++] == ch)
        return strlen((txtMsg + i)) - i;
    else
        return BixFunction(ch);
}
int main()
{
    IndiaBix objBix("Welcome to IndiaBix.com!");
    cout<< objBix.BixFunction('t');
    return 0;
}
[A].6
[B].8
[C].9
[D].15 
Answer: Option A
[A]. Only 1 is correct.
[B]. Only 2 is correct.[C]. Both 1 and 2 are correct.
[D]. Both 1 and 2 are incorrect.
Answer: Option A
#include
int BixFunction(int m)
{
m *= m;
return((10)*(m /= m));
}
int main()
{
int c = 9, *d = &c, e;
int &z = e;
e = BixFunction(c-- % 3 ? ++*d :(*d *= *d));
z = z + e / 10;
cout<< c << " " << e;
return 0;
}
Answer: Option D
#include
class BixBase
{
    int x, y;
    public:
    BixBase(int xx = 10, int yy = 10)
    {
        x = xx;
        y = yy;
    }
    void Show()
    {
        cout<< x * y << endl;
    }
};
class BixDerived
{
    private:
        BixBase objBase; 
    public:
    BixDerived(int xx, int yy) : objBase(xx, yy)
    {
        objBase.Show();
    }
};
int main()
{
    BixDerived objDev(10, 20);
    return 0; 
}
[A].The program will print the output 100.
[B].The program will print the output 200.
[C].The program will print the output Garbage-value.
[D].The program will report compile time error. 
Answer: Option B
#include
enum xyz
{
    a, b, c
};
int main()
{
    int x = a, y = b, z = c;
    int &p = x, &q = y, &r = z;
    p = ++x;
    q = ++y;
    r = ++c;
    cout<< p << q << r;
    return 0;
}
[A].The program will print the output 1 2 3.
[B].The program will print the output 2 3 4.
[C].The program will print the output 0 1 2.
[D].It will result in a compile time error. 
Answer: Option D
#include
class BixBase
{
    int x;
    public:
    BixBase(int xx = 0)
    {
        x = xx;
    }
    void Display()
    {
        cout<< x ;
    }
};
class BixDerived : public BixBase
{
    int y; 
    public:
    BixDerived(int yy = 0)
    {
        y = yy;
    }
    void Display()
    {
        cout<< y ;
    }
};
int main()
{
    BixBase objBase(10); 
    BixBase &objRef = objBase;
    BixDerived objDev(20); 
    objRef = objDev;
    objDev.Display(); 
    return 0; 
}
[A].0
[B].10
[C].20
[D].Garbage-value 
Answer: Option C