LOGICAL OPERATORS

Used to perform logical operations and return a Boolean result.

 

int p = 1, q = 0;

printf("%d\n", p && q);  // Logical AND

printf("%d\n", p || q);  // Logical OR

printf("%d\n", !p);      // Logical NOT