Answer to Question #3309 in C++ for mukunda

Question #3309
Write a program to calculate the sum of two numbers using functions.
1
Expert's answer
2011-07-06T05:38:31-0400
#include <iostream>
using namespace std;

int calculate_sum (int number1, int number2)
{
return number1 + number2;
}

int main()
{
int number1 = 130;
int number2 = 182;

int sum = calculate_sum (number1, number2);
cout << "The sum is " << sum << endl;

return 0;
}

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
New on Blog
APPROVED BY CLIENTS