= = is used for comparison of two quantities and = is used for assignment These operators may be used to form logical expressions. The operands may themselves be other types of expressions. The numeric value of logical expression is 1 if the relation is true and 0 if the relation is false.
Expression using relational and equality operators are shown belowcount <= 100
All relational operators have same precedence followed by equality operators and after that are logical operators. Relational operators have lower precedence than arithmetic operators.Value of count < = 100 is 1, if count has value which is less than or equal to 100.
If count has a value greater than 100, this expression evaluates to false.Value of ch <’T’ is 1, if ch holds a character whose value is less than ‘T’ and it evaluates to false if ch has a value greater than ‘T’.
Expressions connected with logical operators are evaluated from left to right and evaluation stops astruth or falsehood is known.
The truth tables for logical operators can be given as follows:
AND Operator equals true if both its operands evaluates to true.
OR operator evaluates to true if either of its operand evaluates to true, else it equals false.
The unary negation operator (!) converts a non-zero operand into 1.
C Related Interview Questions
|DBMS Interview Questions||C++ Interview Questions|
|C & Data Structures Interview Questions||Java Interview Questions|
|Go (programming language) Interview Questions||F Sharp (programming language) Interview Questions|
|C preprocessor Interview Questions||R Programming language Interview Questions|
|D Programming Language Interview Questions||Lua (programming language) Interview Questions|
|Embedded C Interview Questions|
Introduction To C-programming
Data Types And Storage Classes
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.