Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Functions

Cpp Programming Quiz 204 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
static int Result;
class India
{
public:
void Change(int x = 10, int y = 20, int z = 30)
{
cout<< x + y + z; } void Display(int x = 40, float y = 50.00) { Result = x % x; cout<< Result; } }; class Bix { int x, y; public: void Change(int x, int y = 50) { cout<< x + y; } }; class IndiaBix: public India, public Bix { public: void Display(int x = 10, int xx = 100, int xxx = 1000) { Result = x + xx % x * x; cout<< Result ; } }; int main() { IndiaBix objBix; objBix.India::Display(10, 20.00); return 0; }

[A].The program will print the output 0.
[B].The program will print the output 10.
[C].The program will print the output 30.
[D].The program will print the output 40. 

Answer: Option A

Cpp Programming Quiz 204 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, Functions

Cpp Programming Quiz 205 – What will be the output of the following program?

Question: What will be the output of the following program?

#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

Cpp Programming Quiz 205 – What will be the output of the following program? Read More »

Cpp Programming, Functions