Question: solve it with C language Exercise 1 - Passing variables By Reference (Calling By Reference) (2 marks) Exercise Objectives Declaring pointer variables Assigning pointer variables

solve it with C language
solve it with C language Exercise 1 - Passing variables By Reference

Exercise 1 - Passing variables By Reference (Calling By Reference) (2 marks) Exercise Objectives Declaring pointer variables Assigning pointer variables with references Accessing values using pointers Passing variables by reference Calling functions by references Using references to allow functions to return many values (in/out variables) Problem Description Open replit.com IDE, create a new repl (project) and name it "Lab11Ext". Use this project to write and run a C program that performs the following: Declare the following functions as prototype and implement them after the main function SwapNums(), a function that receives two real (float) pointers a, b, and swaps them. Note: This function not used to print values, just swap a and b] PerformCalc(), a function that receives two real numbers a, b and returns their addition subtraction, multiplication and division values (Hint: Your function prototype should be like this: vold PerformCalc(float a, float b, float add, float sub, float "mul, float *div); [Note: in the same function you need to deal with division by zero problem In the main function declare two real (float) numbers:x and y, and prompt the user to read both of them, then call the functions declared above as follows: Call Swap Nums() by passing the addresses of x and y Call PerformCalc() function for x and y [Declare 4 float variables a, s, m, d to be passed as references in order to hold the addition, subtraction, multiplication and division values.) Organize the output to appear as shown in the sample output below Download your project as zip file and keep it within your file system (Desktop for example) Upload the project to the elearning platform Sample Output Input the value of x 33,4 Please enter the value for y 17.9 After swapping x becomes 179 y becomes 33.4 Performing calculations on x and y Addition: 17.9+33.4 = 513 Subtraction: 179-33,4 =-15.5 Multiplication: 179.33.4 = 597.9 Division: 17.9/33.4 = 0.5 Page 2 of 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!