Cpp Programming Quiz 228 – A destructor takes __________ arguments.
[A].
one
[B].
two
[C].
three
[D].
no
Answer: Option D
Explanation:
No answer description available for this question.
two
[C].
three
[D].
no
Answer: Option D
Explanation:
No answer description available for this question.
Answer: Option C
Answer: Option B
#include
class IndiabixSample
{
public:
int a;
float b;
void BixFunction(int a, float b, float c = 100.0f)
{
cout<< a % 20 + c * --b;
}
};
int main()
{ IndiabixSample objBix;
objBix.BixFunction(20, 2.000000f, 5.0f);
return 0;
}
[A].0
[B].5
[C].100
[D].-5
Answer: Option B
Answer: Option C
#include
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;
}
[A].The program will print the output 5 6 10.
[B].The program will print the output 6 6 10.
[C].The program will print the output 6 6 12.
[D].It will result in a compile time error.
Answer: Option B
#include
class BixData
{
int x, y, z;
public:
BixData(int xx, int yy, int zz)
{
x = ++xx;
y = ++yy;
z = ++zz;
}
void Show()
{
cout<< "" << x++ << " " << y++ << " " << z++;
}
};
int main()
{
BixData objData(1, 2, 3);
objData.Show();
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 4 5 6.
[D].The program will report compile time error.
Answer: Option B