Syntax

BNF

boolean-and-expression
::= <bitwise-or-expression>
::= <boolean-and-expression> <boolean-and-operator> <bitwise-or-expression>

EBNF

boolean-and-expression
::= <bitwise-or-expression> ( <boolean-and-operator> <bitwise-or-expression> ) *

Form

boolean-and-operator
&&

Example

/************************************************
 * File:        logicaland.cpp
 * Description: Program to show examples
 *              of the Boolean AND
 * Date:        11/25/08
 ************************************************/
 
#include <stdio.h>

void Display (int A, int B);

int main () {
  Display (0, 0);
  Display (0, 1);
  Display (1, 0);
  Display (1, 1);
  Display (2, 7);
  Display (15, 22);
}

void Display (int A, int B) {
  int C;
  C = A && B;                            /* Boolean AND */
  printf ("%i && %i is %i\n", A, B, C);
}

Output


    

Reference Links

Boolean AD Operator boolean-and-operator
Bitwise AND Expression <bitwise-and-expression>
Boolean OR Expression <boolean-or-expression>

Other Languages

C Now
C Boolean AND Expression
C++ Now C++ Boolean AND Expression
Java Now Java Boolean AND Expression
PHP Now PHP Boolean AND Expression