Cpp Programming Quiz 52 – Which of the following cannot be used with the keyword virtual?
[B]. member functions[C]. constructor
[D]. destructor
Answer: Option C
Answer: Option C
[B].
[C].
[D].
Answer: Option B
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
class Number
{
int Num;
public:
Number(int x = 0)
{
Num = x;
}
void Display(void)
{
cout<< Num;
}
void Modify();
};
void Number::Modify()
{
int Dec;
Dec = Num % 13;
Num = Num / 13;
if(Num > 0 ) Modify() ;
if(Dec == 10) cout<< "A" ;
else if(Dec == 11) cout<< "B" ;
else if(Dec == 12) cout<< "C" ;
else if(Dec == 13) cout<< "D" ;
else cout<< Dec ;
}
int main()
{
Number objNum(130);
objNum.Modify();
return 0;
}
[A].130
[B].A0
[C].B0
[D].90
Answer: Option B
[B].
Answer: Option B
Explanation:
Both mean two different things. arr gives the address of the first int, whereas the &arr gives the address of array of ints.
[B].
[C].
[D].
Answer: Option C
Explanation:
No answer description available for this question.
#include
class IndiaBix
{
int x, y;
public:
void SetValue(int &a, int &b)
{
a = 100;
x = a;
y = b;
Display();
}
void Display()
{
cout<< x << " " << y;
}
};
int main()
{
int x = 10;
IndiaBix objBix;
objBix.SetValue(x, x);
return 0;
}
[A].The program will print the output 100 10.
[B].The program will print the output 100 100.
[C].The program will print the output 100 garbage.
[D].The program will print two garbage values.
Answer: Option B