A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:
1 + 2
The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.
A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:
1 + 2
The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.
A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:
1 + 2
The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.
A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:
1 + 2
The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.
What they do. Examples:
int x=0, y=0, z=7, v=3;
x==0 y/x==1 result: 1
x==0 | y/x==1 result: abnormal program termination
z & v result: 3
z && v result: 1
1)BITWISE-AND
The bitwise-AND operator compares each bit of its first operand to the corresponding bit of its second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.
101
&100
___________
100 =4
2)LOGICAL-AND
Logical operators do not perform the usual arithmetic conversions. Instead, they evaluate each operand in terms of its equivalence to 0. The result of a logical operation is either 0 or 1. The result's type is int.
printf ("%d", 10<12 && 12<10);
answer: 0
The operands of logical-AND and logical-OR expressions are evaluated from left to right. If the value of the first operand is sufficient to determine the result of the operation, the second operand is not evaluated. This is called "short-circuit evaluation".
MoNu(manish soni)
A binary operator is simply an operator that has two parts, written to the left and to the right of the operator, e.g.:
1 + 2
The binary operator can be a logical operator ("and", "or", "xor", etc. - but "not" is a unary operator), or it can be in some other category, like the arithmetic operator shown above.
The bitwise logical operator and (&) calculates the bitwise logical and of two integral values. It is a binary operator.The address of (&) operator returns the address of the value to its right. It is a unary operator.The distinction between the two is one of context. The logical and operator will follow (and be preceeded by) a value, while the address of operator will follow an operator.
The bitwise & operator performs a bitwise AND operation. The bitwise ^ operator performs a bitwise exclusive OR operation. The bitwise | operator performs a bitwise inclusive OR operation.
The bitwise XOR operator is ^, or shift 6. The bitwise XOR assignment operator is ^=.
There are eight types of operators which are used in C language.These are- 1.Arithmetic operator 2.Assignment operator 3.Relational operator 4.Increment/Decrement operator 5.Bitwise operator 6.Logical operator 7.Conditional operator 8.Additional operator 1.Arithmetic operator:Arithmetic operators are mathmetical operator.These are addition,Subtraction,Multiplication and divison. 2.Assignment operator:Assignment operators are used to store the result of an expression to a variable.
AND, or to be more precise: OR
The bitwise logical operator and (&) calculates the bitwise logical and of two integral values. It is a binary operator.The address of (&) operator returns the address of the value to its right. It is a unary operator.The distinction between the two is one of context. The logical and operator will follow (and be preceeded by) a value, while the address of operator will follow an operator.
The different types of operators are as follows: *Arithmatic operator *Relational operator *Logical operator *Assignment operator *Increment/Decrement operator *Conditional operator *Bitwise operator *Special operator
The bitwise & operator performs a bitwise AND operation. The bitwise ^ operator performs a bitwise exclusive OR operation. The bitwise | operator performs a bitwise inclusive OR operation.
The different types of operators are as follows: *Arithmatic operator *Relational operator *Logical operator *Assignment operator *Increment/Decrement operator *Conditional operator *Bitwise operator *Special operator
The bitwise XOR operator is ^, or shift 6. The bitwise XOR assignment operator is ^=.
There are eight types of operators which are used in C language.These are- 1.Arithmetic operator 2.Assignment operator 3.Relational operator 4.Increment/Decrement operator 5.Bitwise operator 6.Logical operator 7.Conditional operator 8.Additional operator 1.Arithmetic operator:Arithmetic operators are mathmetical operator.These are addition,Subtraction,Multiplication and divison. 2.Assignment operator:Assignment operators are used to store the result of an expression to a variable.
They perform bitwise operations like AND (&), OR (|), XOR (^) and NOT (~).
Bitwise OR [|] operator
The | operator in C is a bitwise inclusive OR. The operator in C is the logical inclusive OR. operator http://msdn.microsoft.com/en-us/library/f355wky8.aspx | operator http://msdn.microsoft.com/en-us/library/edc0fscw.aspx The main difference between the two is does short-circuit evaluation and | does not. Example: 1 1 is true. 1 1 is true.
bitwise OR is used..
AND, or to be more precise: OR
// Note: ^ is the XOR operator a = a ^ b b = b ^ a a = a ^ b