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

What are preprocessor directives?

1 Answers  


write a C program to print the program itself ?!

16 Answers   TCS,


Write a small C program to determine whether a machine's type is little-endian or big-endian.

5 Answers   nvidia,


Function calling procedures? and their differences? Why should one go for Call by Reference?

0 Answers   ADP,


How does free() know how many bytes to free?

8 Answers  


Is exit(status) truly equivalent to returning the same status from main?

0 Answers  


how to write a cprogram yo get output in the form * *** ***** ******* ********* ******* ***** *** *

3 Answers  


how i m write c program 1.check prime number 2.prime number series

1 Answers  


what is foreign key in c language?

1 Answers   ADP,


What is infinite loop?

0 Answers  


Why can't I perform arithmetic on a void* pointer?

0 Answers  


What is call by value in c?

0 Answers  


Categories