Answer to Question #311450 in C++ for Greys

Question #311450

Create a program that will allow user to enter two numbers. Using a function, compute and display for its summation.

1
Expert's answer
2022-03-14T13:04:56-0400
#include <iostream>
using namespace std;


void summation(double x, double y) {
    double z = x + y;
    cout << "Sum is " << z << endl;
}


int main() {
    double x, y;

    cout << "Enter a number: ";
    cin >> x;
    cout << "Enter another number: ";
    cin >> y;


    summation(x, y);


    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