Question #257979

 Write a program to overload unary (-) operator using friend function.


Expert's answer

friend int operator-(int n) {
 return -n;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS