c++ program to illustrate the friend function,here we are finding mean of two numbers.
//wap in c++ to illustrate the friend function,here we are finding mean of two numbers. #include<iostream>using namespace std;class sample{ int num1,num2; public : void setval(); /*here we are passing sample as argument as we are going to pass objects as argument this is the syntax of Passing Objects as Function Arguments*/ friend float mean(sample);};void sample::setval(){ …
c++ program to illustrate the friend function,here we are finding mean of two numbers. Read More »