Skip to main content

Posts

Featured post

Write a program in C++ to overload the binary operator “+” (addition)

Assignment 26 Write a program in C++ to overload the binary operator “+” (addition). Program Code for run:                        #include <iostream> #include <iomanip> using namespace std; class Box {             int l, w, h; public:             Box (int l = 0, int w = 0, int h = 0)             {                         this->l = l;                          this->w = w;                         this->h = h;             }             void operator+( Box b)             {                         Box b1;                         b1.l = this->l + b.l;                         b1.w = this->w + b.w;                         b1.h = this->h + b.h;                    cout << "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ";                cout << endl;                cout << " \t    Addition of Box " << endl;                cout << "       Using + Op

Latest Posts

Write a C++ program creates class time with member function to overload operator + to add two object of type time