Example of a function that is friend of multiple classes? C++ Example

Yes, Friend functionality is not restricted to only one class. One function can be a friend of many classes.

Output

Sum: 7

Friend functionality is not restricted to only one class
Friend functionality is not restricted to only one class
Friend functionality is not restricted to only one class
Friend functionality is not restricted to only one class