C++ example with and without friend function

C++ example with a program with friend function
C++ example with a program with friend function

C++ Program without friend function

C++ Program with friend function

How Friend function Can access private, protected, and public members of a classÂ