3 ed out of question #include using namespace std; class vec { int x, y; public: vec() { x = 0; y = 0; } vec(
Posted: Sat May 14, 2022 7:11 pm
3 ed out of question #include <iostream> using namespace std; class vec { int x, y; public: vec() { x = 0; y = 0; } vec(int a, int b) { x a; y = b; } void printvec(){ cout< < x <<","<< y <<endl; } vec operator++(); }; vec vec::operator++(){ X++; y++; return "this; } int main() { vec V1; ++v1; v1.printvec(); return 0; } a. Compilation Error ОБ. 0 0 CH 2 2 0 d. 1 1
ion 4 et ered ed out of ag question #include <iostream> using namespace std; class base { 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(); 01 111 1 a. 25. 10 O b. 10.5 Oc Compilation Error O d. 2, 10,5 estion 5 #include
ion 4 et ered ed out of ag question #include <iostream> using namespace std; class base { 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(); 01 111 1 a. 25. 10 O b. 10.5 Oc Compilation Error O d. 2, 10,5 estion 5 #include