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

what is the use of operator ^ in C ? and how it works?

Answer Posted / rahul mathur

^ is a exclusive OR bitwise operator.

We can use this "^" operator for swaping two values without
using third variable and without using +, - operator as
shown below:

void xorSwap (int *x, int *y) {
if (x != y) {
*x ^= *y;
*y ^= *x;
*x ^= *y;
}
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between stdio h and conio h?

1371


What does calloc stand for?

1156


What is the difference between text and binary i/o?

1047


Explain do array subscripts always start with zero?

1228


Differentiate between new and malloc(), delete and free() ?

1181


What does %c do in c?

986


Does * p ++ increment p or what it points to?

1117


What is anagram in c?

912


Explain what is the difference between the expression '++a' and 'a++'?

1214


What is c system32 taskhostw exe?

1022


How would you rename a function in C?

1038


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

1094


What are c identifiers?

1087


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

1069


By using C language input a date into it and if it is right?

1079