1 Solved Topic

Remove Filter
Member Avatar for
Member Avatar for neoraghav

The following code swaps values between 2 variables without using a temp variable..... i want to know the logic behind this [CODE] //#include "stdafx.h" #include<stdio.h> int main(){ int a =3, b=5; a^=b^=a^=b; printf("%d" "\n" "%d",a,b); return 0; }[/CODE] [CODE]Output 5 3 [/CODE]

Member Avatar for neoraghav
0
4K

The End.