This program will compute the summary of two numbers, num1 and num2. A function called sum will compute the sum num1 and num2, and return the summed value to the main program. The function sum will not display anything. The main program will display the result.
This
#include <iostream>
#include <iomanip>
using namespace std;
//function prototype
double sum(double,double);
int main()
{
double a,b;
cout<<"Enter a: \n";
cin>>a;
cout<<"Enter b: \n";
cin>>b;
cout<<"The summary of "<<a<<" and "<<b<<" is: ";
cout<<sum(a,b)<<endl;
return 0;
}
//function body
______________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images