Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Logical operators in Operators of Programming in C
1660 Views
Logical operators 
Logical operators are used to test more than one conditions together.
Operators and meaning 
Operators Name Meanings Working style
&& Logical AND Return true when both conditions are true.
Condition 1 Condition 2 Result
true true true
false true false
true false false
false false false
|| Logical OR Return true when atleast one of the condition is true.
Condition 1 Condition 2 Result
true true true
false true true
true false true
false false false
! Logical NOT Return true when condition is false and viceversa.
Condition Result
true false
false true
Program
#include
void main(){
   int a,b,c;
   a = 30;b = 20; c = 10;
   if (a > b && a > c){
      printf("A is big");
   }
   else if (b > c){
      printf("B is big");
   }
   else {
      printf("C is big");
   }
}
Output 
A is big
Previous Topics
Previous lessons of current book.
Introduction of Programming in C
Introduction of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details