5 ed out of question #include using namespace std; class base { protected: | int p=2; int a=10; public: void
Posted: Sat May 14, 2022 7:12 pm
5 ed out of question #include <iostream> using namespace std; class base { protected: | int p=2; int a=10; public: void printp() {cout << p;} }; class deriv : public base { int c=5; public: void printAll(){ printp(); cout << "," «a << "," « c; } }; int main() { deriv obj; obj.printAll(); } a. 10,5 O b. 2., 10.5 O co Compilation Error d. 2 10,5
6 #include <iostream> using namespace std; class base { ed out of question public: int p=1; int a=1; void printp() {cout k p;} }; class deriv : public base { public: int c=5; }; int main() { deriv obj; cout <<obj.p<< "," << obj.a << "," << obj.c; } O a Compilation Erron eb. 1 1 5 OG 1. 15 Od 5.11
6 #include <iostream> using namespace std; class base { ed out of question public: int p=1; int a=1; void printp() {cout k p;} }; class deriv : public base { public: int c=5; }; int main() { deriv obj; cout <<obj.p<< "," << obj.a << "," << obj.c; } O a Compilation Erron eb. 1 1 5 OG 1. 15 Od 5.11