 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can add heights of two persons by overloading binary operators in C++. Before starting, you can note my information. You can connect with me by following these details which are available in front of you. Now I am going to implement a code for you which will demonstrate addition of heights of two persons using binary operator overloading in C++. So first I am including a header file i.e. iostream. Then I am using a namespace std. Now I am defining a class height. Here two attributes I am implementing that are feet and inch. Then in public section, first I am implementing read function. C out will print the message enter feet and inch. C in will read values of feet and inch inside f and i variable. Then second function is print which will display values of feet and inch on console. And L is for line termination. It stands for end line. So this is definition of print function. Now third I am implementing convert function. This function will check if values of inches are greater than equals to 12. Then feet will be incremented by 1. And inch will be decreased by 12. So this is third function. Now I am implementing overloaded operator function i.e. plus. It will add heights of two persons. So here I am declaring a temporary object that is t. Now t.f equals to f plus h.f. Here this f is representing implicit arguments attribute and h.f is representing explicit arguments attribute. That implicit and explicit arguments will be passed at the time of calling of this plus operator. Now second statement is t.i equals to i plus h.i. So this way feet and inches are added. Now I am returning t object which is containing addition of both the objects. Now I am terminating the class. Then I am implementing main function. Here I am creating three objects h1, h2 and h3. Then I am calling read function for h1. Again read function for h2. Then I am calling plus overloaded function using h3 equals to h1 plus h2. Now I am calling convert function and then I am calling print function. At last return statement which is returning zero. So this is the complete implementation of this problem. Now I am executing this code. I am entering two feet four inch three feet six inch. You can see the output two plus three five four plus six ten. It is working properly. Again I am executing this code. I am entering three feet eleven inch four feet ten inch. So addition will be seven and twenty one but see the output twenty one is converted by subtracting twelve from it. So remaining inches are nine three plus four are equals to seven but it is printing eight because inches are converted into feet. This convert function is also working properly. I hope you have understood how you can add heights of two persons by overloading plus operator in C++. If you want to watch more programming related videos you can subscribe my YouTube channel that is Sanjay Gupta underscore tech school. Thank you for watching this video.