susmita dutta chowdhury


{ City } kolkata
< Country > india
* Profession * student
User No # 105949
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 0
Questions / { susmita dutta chowdhury }
Questions Answers Category Views Company eMail




Answers / { susmita dutta chowdhury }

Question { TCS, 13706 }

how to swap two integers 1 and 32767 without using third
variable


Answer

b=(a+b)-(a=b);
printf("%d %d ",a,b);
explanation:-
b=(1+32767)-(a=32767)
b=32768-32767
b=1
a=32767

Is This Answer Correct ?    0 Yes 0 No