 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can implement integer class by overloading plus, minus, multiply and divide 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 coming on to the topic. In this video I am going to demonstrate how integer class can overload plus, minus, multiply and divide operators in C++. First I have included a header file IOS frame, then I have used the namespace std, then integer class is defined which is containing an attribute n, then in public section first function is defined that is read. It will display a message enter a number on console using cout, then it will read a number inside n variable using c in, then print function is implemented which will display value, value equals to message on console and the value that is available inside n variable. After that you can see I have implemented four functions. First one is plus, then minus, then multiply and fourth one is divide. All these functions are known as overloaded operator function because these functions are overloading a particular operator. So this is overloading plus operator. This operator is a keyword and its return type is integer. So it will return an object of the class. It is receiving an argument inside x. So here two arguments will be passed, one will be implicit and second will be explicit. So first time taking you inside main function, here you can see i3 equals to i1 plus i2. This is calling off plus overloaded operator function. Here i1 is passed implicitly and i2 is passed explicitly. Now again coming back to the definition. So i2 will be received inside this x object. So this x dot n is representing values of i2 object and this n is representing values of i1. i1 is implicit. That's why this n is used directly without using any dot operator. So n and x dot n will be added and the result will be stored inside temporary objects and attribute. Then t is returned and this t will be received by i3 object that is available inside function call. So similar to plus, second function is minus. Here plus is replaced with minus. Rest of the statements are same. Similar to minus multiplication is implemented and similarly division operation is implemented. So I hope you have understood all four overloaded operator function definition. Now you can see main function. Here three objects i1, i2, i3 are declared. i1, i2 are calling read function for reading values. Then plus operator overloaded function is called here. It will display values through print function call. Then minus overloaded operator function is called. It will display its value, then multiply and then divide. So all four overloaded operator function definitions are called here using plus, minus, multiply and divide. In each function call i1 is passed implicitly and i2 is passed explicitly and the returned value of t object will be received inside i3. Now I am executing this call. You can see it is asking for first number. I am entering four. It is asking for second number. I am entering two. You can see the result. Some value is six. Subtraction value is two. Multiplication value is eight and division value is two. So all outputs are correct and all these outputs are generated by overloading plus, minus, multiply and divide operators with the concept of binary operator overloading in C++. So I hope you have understood how you can implement integer class to add, subtract, multiply and divide by overloading plus, minus, multiply and divide operators 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.