Question: Write a programmer defined function with void return type that swaps two characters. Your main function must declare two integers and ask the user for
Write a programmer defined function with void return type that swaps two characters. Your main function must declare two integers and ask the user for their values. In your main function, display the characters as well as the memory addresses of the respective variables. Now, call your function to swap the value in the character variables. Inside your function, display the value of the characters before and after swapping, and the memory addresses occupied by the variables in your function. After returning to your main function, display the value of character variables. Use pass by reference method when calling your function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
