How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / emperor of america

using bitwise operator works 100%:
x^=y;
y^=x;
x^=y;

using +/- works sometime, need to consider overflow.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I access an I o board directly?

830


Why can’t constant values be used to define an array’s initial size?

1106


What is the use of printf() and scanf() functions?

822


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

913


show how link list can be used to repersent the following polynomial i) 5x+2

1901


Explain data types & how many data types supported by c?

817


What is difference between structure and union in c programming?

779


What are near, far and huge pointers?

839


What is the use of sizeof () in c?

771


What are the different data types in C?

945


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1963


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1754


program for reversing a selected line word by word when multiple lines are given without using strrev

2173


What does 4d mean in c?

1224


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2459