# bitwise and: &, and

bitwise AND with another name bit clearing operation. it get the bit clear name after logical and operator:just in case it's true if both inputs are true in all other situations the result is false. it transferred to the variables means that only those bits remain set to 1 where both inputs was 1 otherwise resets. this property can be used for example to query the value of a specific bit as follows: for example, if we interest a value of 3rd bit, then we perform bitwise AND of the variable and the number 4, if the result equals 4 so that means that the bit is set, and if not this bit is 0. and why I chose number 4 for example? number 4 displayed in bit form: 0100, only 3rd bit is set to 1, exactly what we want to test.## &

### Description

`par1 & par2`

### Input

- par1 - any integer
- par2 - any integer

### Output

- Result - integers

### Examples

## Example

bitwise and the possible of use:```
x = 0xf & 0xff; // x = 0xf
y = 5 & 3; // y = 1
z = (x & 5) & y; // z = 1
```

## Example

even one example in what situations we can use the operation bitwise and:```
i & j
0xabcd & k
2 & (i & 4)
```

## Example

Other pieces of example codes:z = ~(x & 5) & y

(i & j)

0xff & 0x05

(i & 4)

(i & j)

## and

### Description

`par1 and par2`

### Input

- par1 - any integer
- par2 - any integer

### Output

- Result - integers

compatible programing languages:

Basic | Visual Basic .NET | FreeBASIC | Free Pascal | Object Pascal | Pascal

Basic | Visual Basic .NET | FreeBASIC | Free Pascal | Object Pascal | Pascal

### Examples

## Basic

bitwise and the possible of use:```
x = &Hf and &Hff ' x = 0xf
y = 5 and 3 ' y = 1
z = (x and 5) and y ' z = 1
```

## Basic

even one example in what situations we can use the operation bitwise and:```
i and j
&Habcd and k
2 and (i and 4)
```

## Basic

Other pieces of example codes:(i and 4)

a and b

&Hff and &H05

(i and j)

(i and j)

you can find it in the following collections: bitwise operators

bitwise and in another programming language: