About 18,400,000 results
Open links in new tab
  1. C Logical Operators - GeeksforGeeks

    Mar 26, 2025 · We have 3 logical operators in the C language: Logical NOT ( ! 1. Logical AND Operator ( && ) The logical AND operator (&&) returns true only if both operands are non-zero. Otherwise, it returns false (0). The return type of the result is int. Below is the truth table for the logical AND operator. Syntax. Example. 2. Logical OR Operator ( || )

  2. logical AND and OR in c - Stack Overflow

    Jul 22, 2012 · On the MSDN page for &&: The logical-AND operator produces the value 1 if both operands have nonzero values. Clearly both operands are -1 in your example so they will produce 1. On the same page, listed for ||. If either operand has a nonzero value, the result is 1. In your case one operand is -1, therefore the result is 1.

  3. Logical OR (||) operator with example in C language

    Apr 14, 2019 · In C programming language, there are three logical operators Logical AND (&&), Logical OR (||) and Logician NOT (!). Logical OR is denoted by double pipe characters (||), it is used to check the combinations of more than one conditions; it is a binary operator – which requires two operands.

  4. C Programming: Logical Operators with Examples - w3resource

    Sep 20, 2024 · Learn how to use logical operators (&&, ||, !) in C programming with detailed examples, explanations, and when to use each operator effectively.

  5. Logical Operators in C Programming (Types With Examples)

    Feb 17, 2025 · Learn about logical operators in C programming, including types like AND, OR, and NOT, with detailed examples. Read now!

  6. C Logical Operators - Online Tutorials Library

    Logical operators in C evaluate to either True or False. Logical operators are typically used with Boolean operands. The logical AND operator (&&) and the logical OR operator (||) are both binary in nature (require two operands). The logical NOT operator (!) is a unary operator.

  7. Logical Operators In C (AND, OR, NOT, XOR) With Code Examples

    In this article, we will explore logical operators in C language, their types, usage, etc., with proper code examples. Logical operators are crucial in evaluating conditions and making informed choices within your code.

  8. Logical operators in C language ( &&, ||, and ! ) usage and Examples

    In today’s article, we are going to look at the Logical Operators in C programming. The Relational Operators are useful to find the relations between the two expressions, numbers, etc. But Sometimes there will be the need to combine or check multiple relations at the same time.

  9. C Programming And Or Operator - Gyata

    Nov 30, 2023 · Two such operators that are fundamental to any programming language, including C, are AND and OR, denoted by '&&' and '||' respectively. These operators are widely used in decision-making constructs like 'if', 'else if' and 'while' to combine multiple conditions.

  10. C Logical Operators - Examples - Tutorial Kart

    In C, logical operators are used to perform logical operations on expressions. These operators evaluate Boolean values and are commonly used in decision-making constructs such as if statements and loops. The three logical operators in C are && (Logical AND), || (Logical OR), and ! …

  11. Some results have been removed
Refresh