I'm having trouble with the negation part of this Write a function that accepts two input parameters,computes the difference of those inputs by subtraction, and returns the result. You are NOT allowed to use the subtraction operator (−) . You are, however,allowed to use negation(−y) You must produce the final answer by calling the addition function that you wrote as part of the first problem. Any help would be appreciated
double subtraction(double a, double b);
int main()
{
double num1; //to store first number
double num2; //to store second number
double sum; //to store addition
//read numbers
cout << "Enter first number: ";
cin >> num1;
cout << "Enter second number: ";
cin >> num2;
//call function
addition(num1, num2);
//print addition
cout << "The difference of " << num1 << " and " << num2 << " is: " << sum << endl;
system("pause");
return 0;
}
//function definition
double addition(double a, double b)
{
return (a + b);
}