Question from the C++ test

Write a C++ function that returns the sum of two integers.

Hard

Consider a class Number which has one private data member int n and the following member functions

const Number Number::addInt(int i, const Number& obj)
 {
     	   Number temp;
     	   temp.n = i + obj.n;
     	   return temp;
  }
        	 
 const Number& Number::subInt(int i, const Number& obj)
 {
     	   Number temp;
     	   temp.n = i - obj.n;
     	   return temp;
  }
Author: Abha AgrawaStatus: PublishedQuestion passed 438 times
Edit
3
Community EvaluationsNo one has reviewed this question yet, be the first!