write a program to swap Two numbers without using temp variable.
Answer Posted / anantha
b=a+b
a=b-a
b=b-a
if a=3 and b=5
then now b=a+b=8
and a=8-a=8-3=5,now a=5
b=8-a=8-5=3,now b=3
so, a=5 and b=3
| Is This Answer Correct ? | 198 Yes | 59 No |
Post New Answer View All Answers
What does return 1 means in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
Where does the name "C" come from, anyway?
how many errors in c explain deply
What are header files and explain what are its uses in c programming?
Do you know the use of fflush() function?
How many loops are there in c?
Write programs for String Reversal & Palindrome check
Write a program which returns the first non repetitive character in the string?
What is c language in simple words?
What is the difference between the = symbol and == symbol?
What is #include stdio h and #include conio h?
Explain what is the heap?
What are qualifiers?
Can you subtract pointers from each other? Why would you?