Bird
0
0

Which of the following is the correct syntax for a logical AND operation in C?

easy📝 Syntax Q3 of 15
C - Operators and Expressions
Which of the following is the correct syntax for a logical AND operation in C?
Aa & b
Ba ! b
Ca || b
Da && b
Step-by-Step Solution
Solution:
  1. Step 1: Identify logical AND operator syntax

    Logical AND in C uses double ampersand: &&.
  2. Step 2: Differentiate from bitwise AND

    Single & is bitwise AND, not logical AND.
  3. Final Answer:

    a && b -> Option D
  4. Quick Check:

    Logical AND syntax = && [OK]
Quick Trick: Use && for logical AND, & is bitwise [OK]
Common Mistakes:
  • Using single & for logical AND
  • Using || instead of &&
  • Incorrect operator like ! between variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes