how to swap 2 numbers in a single statement?

Answers were Sorted based on User's Feedback



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

Answer / ushagva1

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

Is This Answer Correct ?    21 Yes 2 No

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

Answer / uj

(x ^= y), (y ^= x), (x ^= y);

Is This Answer Correct ?    0 Yes 0 No

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

Answer / pedda

t=a;
a=b;
b=t;
t means temporary value

Is This Answer Correct ?    3 Yes 7 No

Post New Answer

More C Interview Questions

What is main () in c?

0 Answers  


write a c program to check weather a particluar bit is set or not?

5 Answers   IBM,


design and implement a program that reads floating-points numbers in a sentinel-controlled loop until the user terminates the program by entering zero.your program should determinate and print the smallest,largest and average of the supplied numbers.

2 Answers  


how to write a program which adds two numbers without using semicolon in c

2 Answers  


What are the c keywords?

0 Answers  






Define the scope of static variables.

0 Answers  


. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.

1 Answers  


any "C" function by default returns an a) int value b) float value c) char value d) a & b

0 Answers  


who is first prime minister in india??

8 Answers   Wipro,


What math functions are available for integers? For floating point?

0 Answers  


What is anagram in c?

0 Answers  


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

0 Answers  


Categories