Ravi(Bit Mesra Cse_2K7) said:
(Thu, Oct 21, 2010 12:03:39 AM)
Any bit AND(&) with 0 will give a zero .i.e. will turn that particular bit OFF.
Suhas . U said:
(Fri, Nov 26, 2010 11:07:31 AM)
Which bit u want make 0 ...make only that bit 0 n allother bits 1...
ex:-to make 3rd bit 0 use &operator with one operand as11110111
Arjun Prasad said:
(Mon, Feb 28, 2011 08:15:33 AM)
To make above operand you take a number 1 and then shift its only set bit to the number of the bit you want to turn off(1<<3) and then take AND with given number.
Arjun Prasad said:
(Mon, Feb 28, 2011 08:18:20 AM)
If we take any bit AND (&) with 0 will give a zero. (i.e) Will turn that particular bit OFF.
Saurav said:
(Mon, Sep 5, 2011 12:26:55 AM)
But! why will && not work?
Heena said:
(Fri, Sep 16, 2011 11:08:01 PM)
Because && is a logical operator not a bitwise (bitwise is a operator that takes single bit at a time).
Bari said:
(Thu, Sep 22, 2011 08:05:55 PM)
Please explain about bitwise operator?
Bari said:
(Thu, Sep 22, 2011 08:08:14 PM)
How to work bitwise ?
Vinod Basi said:
(Fri, Nov 4, 2011 10:01:33 PM)
Sorry, I know this is an outdated thread... But just saw Mr.Gaurav's doubt to be one which I had a days back.
Here is a simple explanation, correct me if am wrong.
@Saurav
Its like && and || are logical operators, evaluting true statements.
Eg:
Sachin && Sehwag opens batting, It returns true(1) only if both the guys are present to open the game. Else False(0)
Sachin || Sehwag, return true(1), if either Sachin or Sehwag accompanied by someone else opens the game. Else false(0)
& and | are bitwise operators, High and Low
AND, OR gates truth table pretty much explains it.
Eg:
2 & 3 (AND)
010
&
011
------
010
2 | 3 (OR)
010
|
011
------
011
Bitwise operators can be predominantely found in Embedded design, to find the status (ON or OFF) of a bit in a system.
Hope this explains...
Cheers...
Athi said:
(Tue, Nov 29, 2011 08:44:18 AM)
I have 1 doubt please tell me how to find the status of a bit ie char s[50];
Then write a c program to find the status of 170th bit.
Satyaprakash said:
(Thu, Jan 12, 2012 11:52:47 AM)
Turn off operator in bitwise operators is and because it turns 1&0 and 0&1 into turn off(that is o). |(OR) bitwise turns preceeded operations into turn on(that is 1).
Hence AND IS turn off operator.
Naveen Kumar Ramisetty said:
(Thu, Feb 2, 2012 11:18:12 PM)
Thanks ramya.
Deepanwita said:
(Thu, Jul 26, 2012 10:42:48 PM)
Bitwise operator is more easily been applied than the logical operator.
Mouni said:
(Mon, Sep 3, 2012 11:30:59 AM)
Please explain how to convert hexa decimal into binary.
Saiprabha said:
(Fri, Sep 7, 2012 11:17:05 AM)
If you want to off the bit means u want to make it ZERO it is possible in only & condition because
in & if 1 1 o/p-1
else 0
Dinesh said:
(Tue, Sep 18, 2012 02:42:24 PM)
I explain in simple manner
bit wise & truth table
=========================
a b z
=========================
0 0 0
1 0 0
1 1 1
0 1 0
==========================
only one condition satisfyied foe on bit excpt bit value is off position
Prema Latha.S said:
(Fri, Sep 28, 2012 09:15:42 PM)
Bitwise AND operator (&), one's complement operator(~)
Example: To unset the 4th bit of byte_data or to turn off a particular bit in a number.
Explanation: Consider, Material from Interview Mantra. Subscribe to free updates via email.