#include using namespace std; int main(void) { int a, b; M cout << "Enter first number: "; cin >> a; cout << "Enter second number: "; cin >> b; 11 cout << "Sum = << getSum (a, b); return 0;

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question
  1. In the code editor, you are provided with a main() function that asks the user for two integer inputs, passes these to a function called, getSum(), and then prints the returned value.
  2. Your task is to declare and define the getSum() function which has the following details:
    1. Return type - int
    2. Name - getSum
    3. Parameters - 2 integers
    4. Description - adds the passed integers and returns their sum
  3. DO NOT EDIT ANYTHING IN THE MAIN

use C++

#include <iostream>
using namespace std;
int main(void) {
int a, b;
}
cout << "Enter first number: ";
cin >> a;
cout << "Enter second number: ";
cin >> b;
cout << "Sum = " << getSum(a, b);
return 0;
Transcribed Image Text:#include <iostream> using namespace std; int main(void) { int a, b; } cout << "Enter first number: "; cin >> a; cout << "Enter second number: "; cin >> b; cout << "Sum = " << getSum(a, b); return 0;
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT