Answer to Question #26890 in C++ for Calvin

Question #26890
A program with a function Add that takes two parameters and returns their sum, then call the function from the main
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS