main.c > + c Input 1 #include 3 - int main(void) { int a, b; 1. First integer 4 2. Second integer printf("Enter integer 1: "); scanf("%d", &a); 6. Output 8 9 10 11 12 13 14 15 16 17 printf("Enter integer 2: "); scanf("%d", &b); Enter integer 1: 10 Enter integer 2: 20 exchangeGi ft(&a, &b); 20 110 printf("%d %d", a, b); return 0;

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)

4. 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

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

Step by step

Solved in 4 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