In this program the two numbers to be swapped from each other place with the use of third variable. In program the variables declare for storing the value in it. Here three variables are also declared (a,b,c) the use of only two numbers the swapping will happen. The first number shifted to third variable and then to other variable the reverse phase will be on the move to swap both numbers. And other functionality also comes in light for displaying the result on the screen.
This is C Program to Swap Two Numbers Using Third variable.
- Declaring variable.
- Using swap condition.
- Display result on the screen.
Here is source code of the C program to Swap a Two Number. The C program is successfully compiled. The program output is also shown below.
printf("enter the two value");