(C PROGRAMMING ONLY) 2. Pairing Up by CodeChum Admin You’re tasked with pairing up people with each other but you need to figure out how well both of them work together. In order to find out how effective each pair is, you need to create a program that adds both of their values and returns their sum. Instructions: 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. Your task is to declare and define the getSum() function which has the following details: Return type - int Name - getSum Parameters - 2 integers Description - adds the passed integers and returns their sum DO NOT EDIT ANYTHING IN THE MAIN Input 1. First integer 2. Second integer Output Enter first number: 24 Enter second number: 21 Sum = 45
(C
2. Pairing Up
by CodeChum Admin
You’re tasked with pairing up people with each other but you need to figure out how well both of them work together. In order to find out how effective each pair is, you need to create a program that adds both of their values and returns their sum.
Instructions:
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.
Your task is to declare and define the getSum() function which has the following details:
Return type - int
Name - getSum
Parameters - 2 integers
Description - adds the passed integers and returns their sum
DO NOT EDIT ANYTHING IN THE MAIN
Input
1. First integer
2. Second integer
Output
Enter first number: 24
Enter second number: 21
Sum = 45
![main.c
+ c
1 #include<stdio.h>
Input
2
1. First integer
3 - int main(void) {
int a, b;
4
2. Second integer
printf("Enter first number: ");
scanf("%d", &a);
7
8
Output
printf("Enter second number: ");
scanf("%d", &b);
10
11
Enter first number: 24
12
printf("Sum
%d", getSum(a, b));
Enter second number: 21
13
Sum = 45
14
return 0;
15 }](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8ba97320-f38e-447e-8a6c-e66f253a2656%2F5b73f858-5bfa-4147-9ae2-0dc87232dd23%2F3pjmnq6_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)