## SIZ EDUCATION ||logical operators in C language.

in hive-181430 •  3 years ago 

What are logical operators?Different logical Operators in C language.

Logical Operators.

The logical operators are used to assess compound situations.There are 3 logical operators in C language.
  • AND Operator(&&)
  • OR Operator(| |)
  • NOT Operator(!)

logical_operator_in_c.jpg
Source

1.AND Operator (&&).

The image used for AND operator is (&&).it's far used to eveluate situations. It produces proper end result if each situations are proper.it produces fake end result if someone situation is fake.

Condition 1OperatorConditions 2Result
False&&FalseFalse
False&&TrueFalse
True&&FalseFalse
True&&TrueTrue

Example.

Suppose we've got variables A=a hundred and B=50.The compound situation(A>10)&&(B>50) is proper.it includes situations and each are proper. So the entire compound situation is likewise proper.

The compound situation (A>50)&&(B>50) is fake.it includes situations. One situation (A>50) is proper and 2nd situation (B>50) is fake.So the Whole compound situation is fake.

2.OR Operator ( | | )

The image used for OR operator is ( | | ).it's far used to assess situations.it offers proper end result it both situation is proper. It offers fake end result if each situations are fake.

Condition 1OperatorConditions 2Result
FalseI IFalseFalse
FalseI ITrueTrue
TrueI IFalseTrue
TrueI ITrueTrue

Example.

Suppose we've got variables A=a hundred and B=50.The compound situation (A>50)
| | (B>50) is proper.it includes situations and one situation (A>50) is proper.So the entire compound situation is likewise proper.The compound situation (A>500) | | (B>500) is fake due to the fact each situations are fake.

3.Not Operator (!)

The image used for NOT operator is (!).it's far used to opposite the end result of a situation. It offers proper end result if the situation is fake. It offers fake end result if the situation is proper.

OperatorConditionResult
!TrueFalse
!FalseTrue

Example.

Suppose we've got variables A=a hundred and B=50.The situation! (A==B) Is proper. The end result of (A==B)is fake however NOT operator converts it into proper.The situation !(A-B) is fake. The situation (A>B)is proper however NOT operator converts it into fake.


Special Thanks To Steem Infinity Zone Team.
@siz-official
@cryptokraze
@arie.steem
@vvarishayy
@suboohi
@ashkhan

Thanks For Visiting My Post

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Please read these guidelines and write your post title as mentioned in this post.

https://steemit.com/hive-181430/@siz-official/siz-community-guidelines-on-daily-content-creation-categories

Thank you.
Keep following our community rules.