(C PROGRAMMING ONLY) DO NOT EDIT THE MAIN 7. Special Exchanging Gifts by CodeChum Admin It's Christmas time and we're having this exchanging gifts activity!   I want to surprise the receiver of my gift. After he/she receives my gift, I will add an additional P100 bill!   Instructions: In the code editor, you are provided with a main() function that asks the user for 2 integers. Then, a function call to a function named, exchangeGift() is made and the addresses of the 2 integers are passed. This exchangeGift() function hasn't been implemented yet so this is your task. This has the following description: Return type - void Name - exchangeGift Parameters - 2 addresses of 2 integers Description - swaps the value of the 2 integers and then adds 100 to the 2nd integer (or 2nd parameter) DO NOT EDIT THE MAIN Input 1. First integer 2. Second integer Output Enter integer 1: 10 Enter integer 2: 20 20 110

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(C PROGRAMMING ONLY)

DO NOT EDIT THE MAIN

7. Special Exchanging Gifts
by CodeChum Admin

It's Christmas time and we're having this exchanging gifts activity!

 

I want to surprise the receiver of my gift. After he/she receives my gift, I will add an additional P100 bill!

 

Instructions:

In the code editor, you are provided with a main() function that asks the user for 2 integers. Then, a function call to a function named, exchangeGift() is made and the addresses of the 2 integers are passed.
This exchangeGift() function hasn't been implemented yet so this is your task. This has the following description:
Return type - void
Name - exchangeGift
Parameters - 2 addresses of 2 integers
Description - swaps the value of the 2 integers and then adds 100 to the 2nd integer (or 2nd parameter)
DO NOT EDIT THE MAIN
Input

1. First integer

2. Second integer

Output

Enter integer 1: 10
Enter integer 2: 20
20 110

3. DO NOT EDIT THE MAIN
main.c
< >
+ c
1 #include<stdio.h>
Input
3 - int main(void) {
int a, b;
4
1. First integer
printf("Enter integer 1: ");
scanf("%d", &a);
6
2. Second integer
7
8
printf("Enter integer 2: ");|
scanf("%d", &b);
Output
9.
10
11
12
exchangeGift(&a, &b);
Enter integer 1: 10
13
Enter integer 2: 20
14
printf("%d %d", a, b);
20 - 110
15
16
return 0;
17 }
Transcribed Image Text:3. DO NOT EDIT THE MAIN main.c < > + c 1 #include<stdio.h> Input 3 - int main(void) { int a, b; 4 1. First integer printf("Enter integer 1: "); scanf("%d", &a); 6 2. Second integer 7 8 printf("Enter integer 2: ");| scanf("%d", &b); Output 9. 10 11 12 exchangeGift(&a, &b); Enter integer 1: 10 13 Enter integer 2: 20 14 printf("%d %d", a, b); 20 - 110 15 16 return 0; 17 }
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY