#include <stdio.h>
int main()
{
int A, B;
printf("Please enter the 1st number : ");
scanf("%d",&A);
printf("\nPlease enter the 2nd number : ");
scanf("%d",&B);
printf("\nBefore swapping:\n");
printf("A - %d \nB - %d", A, B);
A = A - B;
B = A + B;
A = B - A;
printf("\nAfter swapping:\n");
printf("A - %d \nB - %d", A, B);
return 0;
}C Programming
Program For Swapping 2 Numbers Without Temp Variable.

Written by
View ProfileNikhil Juneja
Passionate software developer and technical contributor at TutorialsLink.
