Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - There are two variables, A and B, and it is required to exchange the values of A and B without using the third variable.
There are two variables, A and B, and it is required to exchange the values of A and B without using the third variable.
# include & ltiostream & gt

Use namespace std

int main()

{

int a= 100,b = 3;

//The following three sentences are the key points.

a = a+b;

b = a-b;

a = a-b;

printf("%d %d\n ",a,b);

}