Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C Q1 Write a program that does the following: i) Uses scanf to read 2 numbers and assign these to two variables xl, x2
Using C
Q1 Write a program that does the following: i) Uses scanf to read 2 numbers and assign these to two variables xl, x2 in main function ii)Print the contents of these two variables i Definesa function void swapCallByValue(int parameterl, int parameter2). This function swaps the values of parameters provided iv) Calls the function swapCallBy Value(....) in main function v) Prints the values of x1 and x2 in main vi) Defines a function void swapCallByRefernce(.. This function swaps the values pointed to by the parameters provided (pass by referen vii Prints the values of xl and x2 in main viii) Prints the output as shown below Driginally: After swapCallByValue: x1 = 5 and x2 = 10 . x1 5 and x210 Originally: After swapCallByReference: x1 5 and x2 10 x1 1e and x25Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started