Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What does return 1 means in c?

1018


Here is a good puzzle: how do you write a program which produces its own source code as output?

1046


Where does the name "C" come from, anyway?

1090


how many errors in c explain deply

2042


What are header files and explain what are its uses in c programming?

1073


Do you know the use of fflush() function?

1018


How many loops are there in c?

1056


Write programs for String Reversal & Palindrome check

1019


Write a program which returns the first non repetitive character in the string?

1065


What is c language in simple words?

1023


What is the difference between the = symbol and == symbol?

1063


What is #include stdio h and #include conio h?

1051


Explain what is the heap?

1023


What are qualifiers?

984


Can you subtract pointers from each other? Why would you?

921