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;
(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
Step by step
Solved in 4 steps with 2 images