answersLogoWhite

0

a XOR b is a^b in C language

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How do you write a program in C to swap two variables without using the third one using XOR?

a=a^b; b=a^b; a=a^b;


How do you swap two variables using bitwise operators?

a := a XOR b b := a XOR b a := a XOR b it works, but never use it in real programs do you know why its not used in real program??


How do you construct 3 input XOR gate with 2 input XOR gate?

To construct a 3-input XOR gate using 2-input XOR gates, you can connect the inputs in the following way: First, take two of the three inputs (let's call them A and B) and connect them to a 2-input XOR gate, producing an output (let's call it X). Then, connect the output X and the third input (C) to another 2-input XOR gate. The output of this second XOR gate will be the result of the 3-input XOR operation, effectively computing ( A \oplus B \oplus C ).


How can you devise a way to interchange two variables A and B without using a third variable or register using Exclusive OR?

A = A xor B B = A xor B A = A xor B in C... A^=B; B^=A; A^=B;


How to draw the logic circuit for full adder using half adder?

asdfghjkl;' s-sum and c'-carry see for half adder s=a(xor)b and c'=ab for full adder s=a(xor)b(xor)c and c=ab+bc+ac or ab+c(a(xor)b) we can convert two half adder to full adder with help of and or gate. . . ! we got two half adder * for first half adder input is a and b therefore. . .s=a(xor)b and c'=ab * for second half adder input is a(xor)b and c therefore. . .s=a(xor)b(xor)c and c' is (a(xor)b)c note: now connect the c' of first half adder and second half adder to 'or' gate resulting is ab+c(a(xor)b)


What is the difference between Conditional and Logical operator in C?

entirely different thingsconditional operator: ? : logical operators:AND: && OR: NOT: !also you can count XOR: != eg:if ((a==3) != (b==c)) printf ("XOR: Exactly one of the two conditions is true\n");


What is the use of bitwise operator in c plus plus?

They perform bitwise operations like AND (&), OR (|), XOR (^) and NOT (~).


How can you represent XOR function symbol in word?

xor


How do you represent assignment by bitwise XOR operator?

The bitwise XOR operator is ^, or shift 6. The bitwise XOR assignment operator is ^=.


When xor and or operation are same exmple A or B or C equals A xor B xor C?

Check the following table: a b c a+b+c a^b^c 0 0 0 0 0 = 0 0 1 1 1 = 0 1 0 1 1 = 0 1 1 1 0 1 0 0 1 1 = 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 = So they are equal if the number of ones between a, b, and c is zero or an odd number.


How can you write a program to convert binary code to gray code using 8085 microprocessor?

It can be implemented very easily .... Suppose the Binary word is X7X6X5.... X0 then the corresponding Gray code is G7G6G5....G0 where G7=X7 G6=X7 XOR X6 G5=X6 XOR X5 ..... G0=X1 XOR X0 Now implement the above algorithm


What is Full Adder made of?

full adder is made of x-or gates and gates and inverters.it can also be made of two half adders and one or gate.full adder consists of 3 inputs lines and 2 output lines which can be named as sum(s) and carry(c).it is a combinational circuit. s= a xor b xor c(if inputs are named as a ,b,c) c=ab+bc+ca

Trending Questions
Does it matter in what order catch statements for FileNotFoundException and IOException are written? Difference between tubular battery and lead acid cell? A couple is applied to a beam resulting in half of the cross section experiencing tension and the other compression divided by the neutral axis so how do you find which half experiences tension? How long does it take to cure a polyurethane coating on a concrete floor? A steam turbine has an efficiency of 40 percent A steam engine has an efficiency of 25.0 percent Suppose both devices are provided with 1000J of thermal energy How much more useful work will the ste? What is the first code for ghost in the machine? Can people with developmental dyslexia go for engineering? What size motor do you need to run a compressor 2 stage 80 gallon tank i have a 3 phase on it and want to change motor? Is it possible to change an EA Ford 3.9 liter partial injection motor to a full 3.9 liter Multi point injection motor without changing computers? What meters are kept on HV side in SC test? What is the perfect username? What is procedural oriented language? What did Thomas Henry Borden invent? What do crops of the green revolution need in order to produce high yields? What is purpose balance line in centrifugal compressor? What is counter current multistage fluidized bed column? What is the correct code HTML for changing the font style? In Java you want to write a program that will prompt the user for a nonnegative value n the program will then do as follows in the discussion help please? What does char-faced mean? What sound signal should you use if you do not understand another boaters intentions?