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...


swapping of two numbers without using third variable using
AND and OR operators

Answers were Sorted based on User's Feedback



swapping of two numbers without using third variable using AND and OR operators..

Answer / ramesh reddy

a = a^b; b =a^b; a =a^b;
or
a=a+b; b=a-b; a=a-b;

Is This Answer Correct ?    43 Yes 2 No

swapping of two numbers without using third variable using AND and OR operators..

Answer / vignesh1988i

however we can implement using EXoR , where it is made of
AND and OR gate too....

x=90;
y=51;
x^=y^=x;
the value of x & y will be swapped.

Is This Answer Correct ?    8 Yes 8 No

Post New Answer

More C Interview Questions

differentiate built-in functions and user – defined functions.

0 Answers  


Do pointers store the address of value or the actual value of a variable?

0 Answers   Fidelity,


Suggesting that there can be 62 seconds in a minute?

0 Answers  


Why c is called a middle level language?

0 Answers  


is it possible to change the default calling convention in c ?

1 Answers   Aptech,


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


What is cohesion and coupling in c?

0 Answers  


hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


code for copying two strings with out strcpy() function.

6 Answers  


Can we access the array using a pointer in c language?

0 Answers  


Can you write a programmer for FACTORIAL using recursion?

0 Answers   ADP,


Can anyone tell what is stack overflow? what precaution we should take?

1 Answers  


Categories