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 401 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!