Example of Friend function cannot be invoked with the object – C++

The friend function cannot be invoked with the object as the friend function is not in the scope of that class.

friend function cannot be invoked using the object as it is not in the scope of that class
a friend function cannot be invoked using the object as it is not in the scope of that class

The program shows an error because the Friend function cannot be invoked with the object.

Correct program