Qualcomm interview question

white board: swap the values of two pointers without a temp variable

Interview Answers

Anonymous

30 Mar 2018

*a = (*a) *(*b) *b = (*a)/(*b) *a = (*a)/(*b)

Anonymous

25 Feb 2021

*d=(*c+*d)-(*c=*d);

Anonymous

28 Nov 2017

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