answersLogoWhite

0

What is XOR in a c program?

Updated: 12/23/2022
User Avatar

Wiki User

14y ago

Best Answer

a XOR b is a^b in C language

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is XOR in a c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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 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


Is xor gate is derived gate?

yes... xor is derived gate from primary gates