14. C Program to Interchange Contents in Two variables Without Using Temporary Variable.
How does this program work?
- In this programme you will learn how to easily Interchange contents in Two variables without using Temporary variable.
- Here we take only two varibles and store them in A and B variables.
- This programme perform easy mathematical calculations and display the result using C language.
Here is the code
#include <stdio.h>
int main(void)
{
int A=50,B=60;
printf("Before interchanging the values are\n");
printf("A=%d\n",A);
printf("B=%d\n",B);
A=A+B;
B=A-B;
A=A-B;
printf("After interchanging the values are\n");
printf("A=%d\n",A);
printf("B=%d\n",B);
}