Cpp Programming Quiz 140 – Which of the following keywords is used to control access to a class member?
[B]. Break[C]. Protected
[D]. Asm
Answer: Option C
Answer: Option C
Answer: Option C
[D]. Friend
Answer: Option C
The program will print the output Garbage-value.
[C].
The program will report compile time error.
[D].
The program will report runtime error.
Answer: Option C
Explanation:
No answer description available for this question.
#include
class PowerFinder
{
public:
void Power(int x = 1, int y = 1)
{
int P = 1, i = 1;
while(++i <= y)
{
P *= x;
}
cout<< P << endl;
}
};
int main()
{
PowerFinder FP;
FP.Power(2, 6);
return 0;
}
[A].The program will print the output 12.
[B].The program will print the output 16.
[C].The program will print the output 32.
[D].The program will print the output 36.
Answer: Option C
#include
enum bix
{
a=1, b, c
};
int main()
{
int x = c;
int &y = x;
int &z = x;
y = b;
cout<< z--;
return 0;
}
[A].It will result in a compile time error.
[B].The program will print the output 1.
[C].The program will print the output 2.
[D].The program will print the output 3.
Answer: Option C
#include
class IndiabixSample
{
private:
int AdditionOne(int x, int y = 1)
{
return x * y;
}
public:
int AdditionTwo(int x, int y = 1)
{
return x / y;
}
};
int main()
{
IndiabixSample objBix;
cout<
[A].The program will print the output 32 0.
[B].The program will print the output 32 garbage-value.
[C].The program will print the output 32 1.
[D].The program will report compile time error.
Answer: Option D