What is the output of this code? class student { public: student() { age = 0; } student(int init_age) { student(); age =

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

What is the output of this code? class student { public: student() { age = 0; } student(int init_age) { student(); age =

Post by answerhappygod »

What Is The Output Of This Code Class Student Public Student Age 0 Student Int Init Age Student Age 1
What Is The Output Of This Code Class Student Public Student Age 0 Student Int Init Age Student Age 1 (62.1 KiB) Viewed 20 times
What is the output of this code? class student { public: student() { age = 0; } student(int init_age) { student(); age = init_age;) int get_age() {return age; } private: int age; }; class person public: person (std::string init name, int init_age - e, int init_ssn = 2821) name = init_name; age = init_age; ssn = init_55n; private: std::string name; int age; int son: 3: int main() { student mySt1; student mySt2(4); std::cout << mysti.get_age() << std:cendl; std::cout << myStz.get_age() << std::endl; person obj1; return; 000 The following line causes an error, person obj1: The following line causes an error: student myst2(4): The code prints and 4 and successfully completes The following line causes an error: student mySt 1:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply