📅  最后修改于: 2022-03-11 15:00:36.941000             🧑  作者: Mango
//Swapping Using Addition and Subtraction(+ & -)
void swapping(int x, int y)
{
x = x + y; //1
y = x - y; //2
x = x - y; //3
printf("The values of a and b AFTER swapping are a = %d & b = %d \n", x, y);
}
//Swapping Using Multiplication and Division(* & /)
void swapping(int x, int y)
{
x = x * y; //1
y = x / y; //2
x = x / y; //3
printf("The values of a and b AFTER swapping are a = %d & b = %d \n", x, y);
}
//Swapping Using Bitwise XOR
void swapping(int x, int y)
{
x = x ^ y;
y = x ^ y;
x = x ^ y;
printf("The values of a and b AFTER swapping are a = %d & b = %d \n", x, y);
}