swap two integer variables without using a third temporary
variable?

Answer Posted / vignesh1988i

the best way what i choose is that : if x=89 , y=-88

x^=y^=x^=y;

this line will swap the above numbers......


thank u

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you sort filenames in a directory?

612


How are Structure passing and returning implemented by the complier?

717


How many parameters should a function have?

670


How is a null pointer different from a dangling pointer?

561


while initialization of array why we use a[][2] why not a[2][]...?

1869






How would you rename a function in C?

625


What are register variables? What are the advantage of using register variables?

689


Which is best book for data structures in c?

601


What is the difference between declaring a variable and defining a variable?

726


What is d'n in c?

638


Are the expressions * ptr ++ and ++ * ptr same?

671


What is c variable?

556


What is modifier & how many types of modifiers available in c?

614


Is there any data type in c with variable size?

636


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

712