The most basic exchange value

Exchange value
#include<stdio.h>
int main()
{
int a=1;
int b=2;
int c=0;
printf("before exchange a=%db=%d\n",a,b);
c=a;
a=b;
b=c;
printf("After exchange a=%db=%d\n",a,b);
return 0;
}

Guess you like

Origin blog.51cto.com/15006323/2551956