Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
113 views
in C Programming by (178k points)
What are the logical operators in C?

Please log in or register to answer this question.

1 Answer

0 votes
by (178k points)

Logical operators are used to perform logical operations on conditions. They return either 0 (false) or 1 (true). Here are the logical operators in C:

  • Logical AND (&&): Returns true if both conditions on the left and right are true.

    int x = 5;
    int y = 10;
    int result = (x > 0 && y < 20); // result = 1 (true)
     
  • Logical OR (||): Returns true if either of the conditions on the left or right is true.

    int a = 5;
    int b = 10;
    int result = (a > 0 || b > 20); // result = 1 (true)
     
  • Logical NOT (!): Returns true if the condition is false and false if the condition is true.

    int flag = 0;
    int result = !flag; // result = 1 (true)

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
0 votes
1 answer

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...