Answer to Question #26890 in C++ for Calvin
A program with a function Add that takes two parameters and returns their sum, then call the function from the main
1
2013-03-29T09:51:24-0400
#include <iostream>
using namespace std;
// function that takes two parameters and returns their sum
int Add(int a, int b)
{
return a +b;
}
void main()
{
// callfunction Add and print the result
cout<< "5 + 9 = " << Add(5,9);
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment