how to swap 2 numbers within a single statement?

Answers were Sorted based on User's Feedback



how to swap 2 numbers within a single statement?..

Answer / ushabharath

a=a+b-(b=a);

Is This Answer Correct ?    27 Yes 8 No

how to swap 2 numbers within a single statement?..

Answer / srinidhi

a=(a+b)-(b=a);

Is This Answer Correct ?    10 Yes 2 No

how to swap 2 numbers within a single statement?..

Answer / raja

a^=b^=a^=b;

Is This Answer Correct ?    6 Yes 1 No

how to swap 2 numbers within a single statement?..

Answer / ratishchandra huidrom

if(c=a&&a=b&&b=c)printf("%d %d",a,b);

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

What is bash c?

0 Answers  


what is the meaning of 'c' language

3 Answers  


write a prgram of swapping with 2 valiables

6 Answers  


Why c is called a mid level programming language?

0 Answers  


Explain what is a stream?

0 Answers  






Is c easier than java?

0 Answers  


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

0 Answers   TCS,


Do character constants represent numerical values?

0 Answers  


What is exit() function?

0 Answers  


Whats s or c mean?

0 Answers  


i want to know the procedure of qualcomm for getting a job through offcampus

0 Answers   HCL,


how to determine the complexity of an algorithm as log(n)

1 Answers   Google,


Categories