swap with out using temporary

This tip submitted by raghava on 2006-07-17 05:26:35. It has been viewed 26466 times.
Rating of 6.3 with 419 votes



int a,b;
scanf("%d %d",&a,&b);
b=(a+b)-(a=b);
printf("%d %d",a,b);




More tips

Help your fellow programmers! Add a tip!