Cpp Programming Quiz 175 – Which of the following function / type of function cannot be overloaded?
[A].Member function
[B].Static function[C].Virtual function
[D].Both B and C
Answer: Option C
Answer: Option C
Destructor has the same name as that of the class with a tilde symbol at the beginning.
[C].
Both A and B.
[D].
Destructor has the same name as the first member function of the class.
Answer: Option C
Explanation:
No answer description available for this question.
The program will print the output 108.
[C].
The program will print the output garbage value.
[D].
The program will report compile time error.
Answer: Option A
Explanation:
No answer description available for this question.
#include
int main()
{
int arr[] = {1, 2 ,3, 4, 5};
int &zarr = arr;
for(int i = 0; i <= 4; i++)
{
arr[i] += arr[i];
}
for(i = 0; i <= 4; i++)
cout<< zarr[i];
return 0;
}
[A].The program will print the output 1 2 3 4 5.
[B].The program will print the output 2 4 6 8 10.
[C].The program will print the output 1 1 1 1 1.
[D].It will result in a compile time error.
Answer: Option D
Answer: Option D
[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 C
#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 : public BixBase
{
private:
BixBase objBase;
public:
BixDerived(int xx, int yy) : BixBase(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 A