Then maybe you should change your code so it doesn't minus everything.
sum-=a[i];
Every number that is in the array will be reversed. If it is 5, -5 will go into sum. So change your code to make it do what you want. Which apparently is to not reverse the first number, but only the second and third.
Your code already minuses 3 numbers. Now take a thinker and make it minus 2 numbers instead of 3, it should not be very hard if you actually try, which you are not right now. Work on it yourself and you'll learn more.
#include <iostream>
int add( int a[] ) ;
int main()
{
int num[3] ;
for( int i = 0; i < 3; ++i)
{
std::cout << "enter number: " ;
std::cin >> num[i] ;
}
std::cout << add( num ) ;
return 0 ;
}
int add( int a[] )
{
int sum = a[0] ;
for( int i = 1; i < 3; ++i )
{
sum -= a[i] ;
}
return sum ;
}