What are logical operators?Different logical Operators in C language.
Logical Operators.
- AND Operator(&&)
- OR Operator(| |)
- NOT Operator(!)
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 1 | Operator | Conditions 2 | Result |
---|---|---|---|
False | && | False | False |
False | && | True | False |
True | && | False | False |
True | && | True | True |
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 1 | Operator | Conditions 2 | Result |
---|---|---|---|
False | I I | False | False |
False | I I | True | True |
True | I I | False | True |
True | I I | True | True |
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.
Operator | Condition | Result |
---|---|---|
! | True | False |
! | False | True |
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
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.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit