Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lets consider the following program: #include iostream include using namespace std; int addition (int, int ); int subtraction (int , int ); void directions(); void
Lets consider the following program:
#include iostream
include
using namespace std;
int addition (int, int );
int subtraction (int , int );
void directions();
void printResult(int , int , int , string);
int main ()
{
int x,y,r;
directions();
cout << "Please enter the first integer: "<<;
cin >> x;
cout << "Please enter the second integer: ";
cin >> y;
r = addition(x,y);
printResult(x,y,r,"+");
r = subtraction(x,y);
printResult(x,y,r,"-");
system("pause");
return 0;
}
int addition (int a, int b)
{
int r;
r=a+b;
return r;
}
int subtraction (int a, int b)
{
int r;
r=a-b;
return r;
}
void directions()
{
cout << ********************************************************" << endl
<< "Hello!" << endl
<< "This Program asks the user for two integers, then prints the sum and difference" << endl
<< "******************************************************" << endl << endl;
}
void printResult(int a, int b, int result, string operation)
{
cout << a << " " << operation << " " << b << " = " << result << endl;
}
1) Give the prototype of each function.
2) Give the arguments of each function.
3) give the parameters of each function.
Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started