Write a program to find average of a given number using friend function
Anonymous:
language?
Answers
Answered by
0
step1: Start the program.
step2: Declare the class name as base with data members and member function.
step3: The function get () is used to read the 2 inputs from the user.
step4: Declare the friend function mean (base ob) inside the class.
step5: Out side the class to define the friend function and do the following.
step6: Return the mean value (ob. val1 +ob.val2)/2 as a float.
step7: Stop the program.
Similar questions