List of operators that cannot be overloaded.
Increment the time using ++
Decrement the time using ++
Add two object using “+” operator with friend function
class distance (feet,inches) with “+” operator
class distance (feet,inches) with “+” operator with friend function
class distance (km,m) with “+” operator
class distance (km,m) with “+” operator with friend function
class distance (m,cm) with “+” operator
class distance (m,cm) with “+” operator with friend function
class distance (km,m,cm) with “+” operator
class distance (km,m,cm) with “+” operator with friend function
class distance (km,m,cm,mm) with “+” operator
class distance (km,m,cm,mm) with “+” operator with friend function
class time(hh,mm,ss) with “+” operator
class time(hh,mm,ss) with “+” operator with friend function
class complex(real,ing) with “+” operator
class complex(real,ing) with “+” operator with friend function
class string(str) with “+” operator
class string(str) with “+” operator with friend function

Example:16
Declare a class named “distance” with attributes as km, m, cm and mm. Take input for two objects calculate and print their sum using overloaded binary operator “+”.

`code`

Output:

Example:17
Declare a class named “distance” with attributes as km, m, cm and mm. Take input for two objects calculate and print their sum using overloaded binary operator “+” with friend function.

`code`

Output:

Example:18
Declare a class named “time” with attributes as hh, mm, ss. Take input for two objects calculate and print their sum using overloaded binary operator “+”.

```//Add two time objects

#include<iostream>
#include<conio.h>
using namespace std;
class time
{
private:
int h,m,s;
public:
void show();
time operator+(time t1);
};
{
cout<<"enter h,m and s ";
cin>>h>>m>>s;
}
void time::show()
{
cout<<h<<" : "<<m<<" : "<<s<<endl;
}
time time::operator+(time t1)
{
time t;
t.h=h+t1.h;
t.m=m+t1.m;
t.s=s+t1.s;
if(t.s>=60)
{
t.m=t.m+t.s/60;
t.s=t.s%60;
}
if(t.m>=60)
{
t.h=t.h+t.m/60;
t.m=t.m%60;
}
return(t);
}
int main()
{
time e1,e2,e3;
e1.show();e2.show();
e3=e1+e2;//e3=e1.operator(e2);
e3.show();
getch();
return(0);
}

```

Output:

enter h,m and s 3 6 9
enter h,m and s 4 5 8
3 : 6 : 9
4 : 5 : 8
7 : 11 : 17