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 / yash paranjape

a=a^b;
b=a^b;
a=a^b;


i.e
a^=b;
b^=a;
a^=b;

more simplifie i.e in just one line
a^=b^=a^=b;

This also works fine

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use stdio h and conio h?

1094


Write a code to generate a series where the next element is the sum of last k terms.

1229


Explain can you assign a different address to an array tag?

1054


What do you know about the use of bit field?

1050


What is LINKED LIST? How can you access the last element in a linked list?

1075


What are logical errors and how does it differ from syntax errors?

1306


What are local static variables?

1155


What is the function of this pointer?

1348


hi any body pls give me company name interview conduct "c" language only

2289


Can you write the algorithm for Queue?

2125


Is c# a good language?

1015


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

1106


What is bss in c?

1106


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

2023


How does struct work in c?

1094