Code For NonGeek
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Swap variables without using temp

2 posters

Go down

Swap variables without using temp Empty Swap variables without using temp

Post  Admin Wed Aug 24, 2011 3:18 pm

a=a^b
b=a^b
a=a^b

Admin
Admin

Posts : 131
Join date : 2011-08-16

https://codefornongeek.forumotion.com

Back to top Go down

Swap variables without using temp Empty Re: Swap variables without using temp

Post  viterbi Thu Sep 08, 2011 9:59 pm

This only works for integer, there is another version which work for float

a = a+b;
b = a-b;
a = a-b;

viterbi

Posts : 32
Join date : 2011-09-03

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum