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 / swechha

a=a-b
b=a+b
a=b-a

if a=5 and b=10 then
a=5-10=(-5)
b=(-5)+10=5
a=5-(-5)=5+5=10

now a=10 & b=5

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is assert and when would I use it?

1031


can anyone please tell about the nested interrupts?

2131


What is the difference between typedef struct and struct?

1122


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2656


Is void a keyword in c?

994


How do you print an address?

1281


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1259


What is openmp in c?

1031


What is the code for 3 questions and answer check in VisualBasic.Net?

2177


How do you view the path?

1141


Why is c platform dependent?

1103


Is r written in c?

1166


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3593


What is the need of structure in c?

1137


What is header file definition?

1099