swap with out using temporary

This tip submitted by raghava on 2006-07-17 05:26:35. It has been viewed 12555 times.
Rating of 5.7 with 291 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!