This function returns the result of a bitwise `AND` operation on arguments. There must be at least two arguments. Its syntax is as follows:

and(num1, num2 [, …])

In the `and` operation, for the output to be `1`, both the bits that are given as input should be `1` and not `0`. The following truth table summarizes how the `and` operation works when processing two bits:

*0 and 0 = 0 *

*0 and 1 = 0*

*1 and 0 = 0*

*1 and 1 = 1*

The following shows how the `and` operation works when processing the decimal `5`, and `6` illustrates the working of `and()` function:

*5 = 101*

*6 = 110*

*5 and 6 = 100 which is decimal 4*

The following example shows how the `and(num1, num2)` functions work:

$ vi and.awkBEGIN {num1 = 5num2 = 6result = and(num1,num2)printf ...