swap with out using temporary

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