c program to implement swapping

// Swap values in three variables

# include<stdio.h>
#include<conio.h>
void main()
{
int x,y,z,temp;
printf("Enter the value of x,y&z: ");
scanf("%d%d%d",&x,&y,&z);
temp=x;  // swapping starts here
x=y;
y=z;
z=temp;
printf("Values after swapping:\n");
printf("x= %d\ny= %d\nz= %d",x,y,z);
getch();
}

Output

swap 3 variables c program
Swap three variables in c