Cpp Programming Quiz 213 – Can a class have virtual destructor?
[B]. No Answer: Option A
Answer: Option C
#include
int main()
{
int x = 80;
int &y = x;
x++;
cout << x << " " << --y;
return 0;
}
[A].The program will print the output 80 80.
[B].The program will print the output 81 80.
[C].The program will print the output 81 81.
[D].It will result in a compile time error.
Answer: Option A
Answer: Option B
#include
int main()
{
int m = 2, n = 6;
int &x = m;
int &y = n;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n;
return 0;
}
[A].The program will print output 2 6.
[B].The program will print output 3 7.
[C].The program will print output 4 8.
[D].The program will print output 5 9.
Answer: Option C
Answer: Option A
#include
class IndiaBix
{
int K;
public:
void BixFunction(float, int , char);
void BixFunction(float, char, char);
};
int main()
{
IndiaBix objIB;
objIB.BixFunction(15.09, 'A', char('A' + 'A'));
return 0;
}
void IndiaBix::BixFunction(float, char y, char z)
{
K = int(z);
K = int(y);
K = y + z;
cout<< "K = " << K << endl;
}
[A]. The program will print the output M = 130.
[B]. The program will print the output M = 195.
[C]. The program will print the output M = -21.
[D]. The program will print the output M = -61.
Answer: Option D