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

Answer Posted / vinay sachan

exclusive OR ^ is a bitwise operator known as (left assoc).

expr1 ^ expr2

ex.

0x12 ^ 0x58

returns 0x4A (the set bits in the result are those that are set in either 0x12 or 0x58, but not set in both).

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain #pragma statements.

604


Explain what are the __date__ and __time__ preprocessor commands?

594


What is operator promotion?

629


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5804


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

688






Explain indirection?

646


What are different types of operators?

598


What are header files in c?

618


What is the use of structure padding in c?

563


What are loops in c?

551


Where are c variables stored in memory?

599


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1587


Explain null pointer.

622


Which is better between malloc and calloc?

671


Is there a way to compare two structure variables?

617