Question: Option 1 : Write a program that will read two floating point numbers ( the first read into a variable called first and the second
Option : Write a program that will read two floating point numbers the first read into a variable called first and the second read into a variable called second and then calls the function swap with the actual parameters first and second. The swap function having formal parameters number and number should swap the value of the two variables. Note: This is similar to a program you did in Lesson Set ; however, now you are required to use a function. You may want to look at logicprobcpp from Lesson Set Sample Run: Enter the first number Then hit enter Enter the second number Then hit enter You input the numbers as and After swapping, the first number has the value of which was the value of the second number The second number has the value of which was the value of the first number Exercise : Compile the program and correct it if necessary until you get no syntax errors. Exercise : Run the program with the sample data above and see if you get the same results. Exercise : The swap parameters must be passed by Assume that main produces the output. Why?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
