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 the right type to use for boolean values in c? Is there a standard type?

1060


Can you think of a logic behind the game minesweeper.

2520


How many identifiers are there in c?

1083


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1964


What is the difference between a function and a method in c?

1134


What is difference between structure and union with example?

1121


what is the difference between 123 and 0123 in c?

1276


Why is c called a structured programming language?

1333


How old is c programming language?

1063


Can a pointer point to null?

1118


Explain what is the purpose of "extern" keyword in a function declaration?

1125


Hi can anyone tell what is a start up code?

2135


What is 1f in c?

2728


How do you define a function?

1076


In c programming language, how many parameters can be passed to a function ?

1167