1. What will be the output of the following program? #include<iostream.h> class Base { public: char S, A, M; Base(char x, char y) { S = y - y; A = x + x; M = x x; } Base(char, char y = 'A', char z = 'B') { S = y; A = y + 1 - 1; M = z - 1; } void Display(void) { cout<< S << " " << A << " " << M << endl; } }; class Derived : public Base { char x, y, z; public: Derived(char xx = 65, char yy = 66, char zz = 65): Base(x) { x = xx; y = yy; z = zz; } void Display(int n) { if(n) Base::Display(); else cout<< x << " " << y << " " << z << endl; } }; int main() { Derived objDev; objDev.Display(0-1); return 0; }






Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Show Similar Question And Answers
QA->The program that monitors users activity on internet and transmit that information in background to somewhere else is termed as....
QA->Average height of 10 students in a class is 150 cm. A boy of height 160 cm left the class and a boy of height 148 cm is admitted. Then what is the average height of the students in the class now?....
QA->There are 50 students in a class. In a class test 22 students get 25 marks each, 18 students get 30 marks each. Each of the remaining gets 16 marks. The average mark of the whole class is :....
QA->Which one of the following is an output device?....
QA->Name the translatory program which translates the high level language into machine language before running the program?....
MCQ->What will be the output of the following program? #include<iostream.h> class Base { public: int S, A, M; Base(int x, int y) { S = y - y; A = x + x; M = x x; } Base(int, int y = 'A', int z = 'B') { S = y; A = y + 1 - 1; M = z - 1; } void Display(void) { cout<< S << " " << A << " " << M << endl; } }; class Derived : public Base { int x, y, z; public: Derived(int xx = 65, int yy = 66, int zz = 67): Base(x) { x = xx; y = yy; z = zz; } void Display(int n) { if(n) Base::Display(); else cout<< x << " " << y << " " << z << endl; } }; int main() { Derived objDev; objDev.Display(-1); return 0; }....
MCQ->What will be the output of the following program? #include<iostream.h> class Base { public: char S, A, M; Base(char x, char y) { S = y - y; A = x + x; M = x x; } Base(char, char y = 'A', char z = 'B') { S = y; A = y + 1 - 1; M = z - 1; } void Display(void) { cout<< S << " " << A << " " << M << endl; } }; class Derived : public Base { char x, y, z; public: Derived(char xx = 65, char yy = 66, char zz = 65): Base(x) { x = xx; y = yy; z = zz; } void Display(int n) { if(n) Base::Display(); else cout<< x << " " << y << " " << z << endl; } }; int main() { Derived objDev; objDev.Display(0-1); return 0; }....
MCQ->Which of the following statement is correct about the program given below? #include<iostream.h> class IndiaBix { int x; float y; public: void BixFunction(int = 0, float = 0.00f, char = 'A'); void BixFunction(float, int = 10.00, char = 'Z'); void BixFunction(char, char, char); }; int main() { IndiaBix objBix; objBix.BixFunction(10 1.0, int(56.0)); return 0; } void IndiaBix::BixFunction(int xx, float yy, char zz) { x = xx + int(yy); cout<< "x = " << x << endl; } void IndiaBix::BixFunction(float xx, int yy, char zz) { x = zz + zz; y = xx + yy; cout<< " x = " << x << endl; } void IndiaBix::BixFunction(char xx, char yy, char zz) { x = xx + yy + zz; y = float(xx 2); cout<< " x = " << x << endl; }....
MCQ->What will be the output of the following program? #include<iostream.h> class Base { int x, y; public: Base() { x = y = 0; } Base(int xx) { x = xx; } Base(int p, int q = 10) { x = p + q; y = q; } void Display(void) { cout<< x << " " << y << endl; } }objDefault(1, 1); class Derived: public Base { Base obj; public: Derived(int xx, int yy): Base(xx, xx + 1) { } Derived(Base objB = objDefault) { } }; int main() { Derived objD(5, 3); Derived ptrD = new Derived(objD); ptrD->Display(); delete ptrD; return 0; }....
MCQ->What is correct about the following program? #include<iostream.h> class Base { int x, y, z; public: Base() { x = y = z = 0; } Base(int xx, int yy = 'A', int zz = 'B') { x = xx; y = x + yy; z = x + y; } void Display(void) { cout<< x << " " << y << " " << z << endl; } }; class Derived : public Base { int x, y; public: Derived(int xx = 65, int yy = 66) : Base(xx, yy) { y = xx; x = yy; } void Display(void) { cout<< x << " " << y << " "; Display(); } }; int main() { Derived objD; objD.Display(); return 0; }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution