Relational And Logical Operators In C.

Relational And Logical Operators In C.


Hello Programmers,

Today we will discuss relational and logical operators in c language. In the last blog, we studied about operators and type of operators and also studied about Arithmetic operators.

Today we will discuss 2 more operators one is relational operators and other is logical operators


1) Relational Operators:


As the name suggests relational operators are those operators which used to compare two operands.

whenever you use relational operators you must need two operands because relational operators work on two operands. In c language, there are many relational operators and all c relational operators are binary operators and they require two operands.

The result which is returned by relational operators is some logical value which can be either true or false. If it returns zero when the relation is false and returns one when it is true.


List Of Relational Operators In C Language.


2) Logical Operators:


Logical operators are those operators which used to connect two or more relational expression to form a complex expression are termed as logical operators.

A value obtained by evaluating a logical expression is always logical i.e. true or false.

In c language, there are three types of logical operators.

i) Logical and

ii) Logical or

iii) Logical not


Logical Operators In C Language. 




i) Logical and:

when both operand are true then && operators give result true otherwise it give result false.

ii) Logical or:

When both operand are false then || operators give result false otherwise it five results true.

iii) Logical not:

logical not operators return the reverse of what is evaluated.


Sharing Is Caring...


Comments :

Post a Comment