Question: 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 x25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
