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 temporary
variable?

Answer Posted / sam

let a and b be variables
a^=b^=a^=b;
by performing this logic from right hand side we can swap
two variables

Is This Answer Correct ?    6 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are directives in c?

937


Write a program to swap two numbers without using the third variable?

1032


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1037


what are the different storage classes in c?

1144


What is conio h in c?

1013


What is a lookup table in c?

1064


What is a null pointer in c?

1161


What is array of structure in c?

1124


how could explain about job profile

1879


What is union in c?

1079


What are keywords in c with examples?

1056


Why does everyone say not to use gets?

1054


Create a simple code fragment that will swap the values of two variables num1 and num2.

1243


Explain what is wrong with this program statement? Void = 10;

1211


How do we make a global variable accessible across files? Explain the extern keyword?

1846