IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C# Programming Java Programming
Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C Programming - Bitwise Operators - Discussion

@ : Home > C Programming > Bitwise Operators > General Questions - Discussion

4. 

Which bitwise operator is suitable for checking whether a particular bit is on or off?

[A]. && operator[B]. & operator
[C]. || operator[D]. ! operator

Answer: Option C

Explanation:

No answer description available for this question.


Kishore said: (Tue, Aug 10, 2010 03:44:50 AM)    
 
As we know that truth table of AND is if 2 number is true then only output becomes true. For that reason & is used to find bits on or off.

Harshit Bhatia said: (Thu, Oct 28, 2010 09:06:53 AM)    
 
Yaa, & operator is perfect for find out on or off.

Madhureddy said: (Wed, Feb 2, 2011 11:57:10 AM)    
 
Hai frndz. How & operator is used to check whether a bit is on or off is as follows let us conceive that there is a binary num 10101000 if you want to check third bit is on or off then perform and operation to 00001000 then if 3rd bit is 1 its on else its turned off.

Here if wana check nth bit make n-1 bit as 1 remaining as 0. Then perform and operation then you will know the answer.

Siraj said: (Fri, Feb 4, 2011 12:50:02 AM)    
 
Hey anybody can explain me how & operatoer is used to chek on or off ?

Amit(Saktimaan) said: (Thu, Mar 3, 2011 05:56:45 AM)    
 
I don't understand this.

Seenu said: (Sat, Mar 12, 2011 11:27:03 PM)    
 
Hi! Guys this is a simple one. Let consider 8-bit binary number,

Binary(8 bit) = 0000 1100
suppose we want check 3rd bit is on or off(on=1 & off=0), just like this,

0000 1100 (Decimal=12)
&
0000 0100 (Decimal=4,we are checking 3rd bit so it is 1)
----------
0000 0100 (Decimal=4)
----------
If we got some value then checking bit is on,otherwise off.
In C language,

if(12&4)
print("The third bit is on");
else
print("The third bit is off");

Riya said: (Fri, Apr 29, 2011 12:44:11 PM)    
 
What is the difference between && and & ?

Payal said: (Mon, May 23, 2011 01:22:20 PM)    
 
&& is a relational operator it compare two values.

Whereas & is logical operator.

Ajendra Singh said: (Mon, Aug 22, 2011 04:29:37 PM)    
 
Relation operator is used to make an expression to compound one whereas bitwise and is used to operate on bits for faster access.

Ullas Kulkarni said: (Wed, Sep 14, 2011 03:28:24 PM)    
 
In detail,,
The key difference between & and && is ,its return value
EX; 1&2 returns zero whereas 1&&2 returns one ..
check out
1=0001 & 0010= 0000 on & opertion
and 1(true) and 2(true) so 1&& 2=1(true)

Write your comments here:
Name *:     Email:


© 2008-2011 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Advertise     Contact us: info@indiabix.com     Follow us on twitter!