Define the Logical Operators in c language?
The Logical operators deals with the ways the relationships are able to connected. C has the following three logical operators
Operator Purpose
&& logical and
|| logical or
! logical not
The logical operators && and || are meant to use when we wish to test more than one condition and make decision
An instance is
(p
Truth table for the logical operators is display here using 1 and 0.
P
|
Q
|
P&&Q
|
P||Q
|
!P
|
0
|
0
|
0
|
0
|
1
|
1
|
0
|
0
|
1
|
0
|
0
|
1
|
0
|
1
|
1
|
1
|
1
|
1
|
1
|
0
|