1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of AND

By David Bolton, About.com

Definition: AND is an operation between two bits. If both bits are set then the result is set otherwise the result is clear. This can be shown as below.
A B --- A AND B
0 0 ----- 0
0 1 ----- 0
1 0 ----- 0
1 1 ----- 1
In C, C++ and C# binary AND is represented by a single character &.

In expressions, AND is represented by the double character && as in

if (a==2) && (b==3) { //.. rest of code
Which means if a equals 2 and b equals 3

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Examples:
OR is often used to combine bytes together.
Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.