This is C program where user asks to interchange the two values with each other using Call by reference method. Declaring the required variable for functionality. Then after user declare void swap() function that which will give the reference to other class for interchange. After that user call the function that declare void swap() then using method to interchange the value of variables with the help of pointer concept to declare pointer type variables that are useful while using the call by reference method. In the end the result has to be display on the screen.
This is C program that asks the user to interchange the value of two variables with use of call by reference Method.
- Declaring variables.
- Make function.
- Calls the function.
- Using Interchange method for value swapping.
- Display result on the screen.
Here is C source code for interchange value of two variables using Call by reference Method. The output of this program shown below.
void swap(int *x,int *y);
printf("\nAfter Swaping Result is :\na=%d b=%d ",a,b);
void swap(int *x,int *y)