Vidyalelo
C++ Programming · Q55

Classes and Objects in C++

Programming · C++ Programming · question 55

Q55

Given the following C++ code. How would you define the #include using namespace std; class Box int capacity; public: Box() Box(double capacity) this->capacity = capacity; ; int main(int argc, char const *argv[]) Box b1(10); Box b2 = Box(14); if(b1 < b2) cout<<"Box 2 has large capacity."; else cout<<"Box 1 has large capacity."; return 0;

Options are not available for this question.

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board