Our website use cookies, which help us to improve our site and enables us to deliver the best possible service and customer experience. By clicking accept you are agreeing to our cookies policy. Find out more
If you notice any factual inaccuracies or other issues with this profile, please let us know. Please do not include any personal health information in this form.
Like Answer
Logical Operators
An expression containing logical operator returns
either 0 or 1 depending upon whether expression
results true or false. Logical operators are
commonly used in decision making in C
programming .
Operator
Meaning of Operator
Example
&&
Logial AND. True only if all operands are true
If c = 5 and d = 2 then, expression ((c == 5) &&
(d > 5)) equals to 0.
||
Logical OR. True only if either one operand is
true
If c = 5 and d = 2 then, expression ((c == 5) || (d
> 5)) equals to 1.
!
Logical NOT. True only if the operand is 0
If c = 5 then, expression ! (c == 5) equals to 0.
Arithmetic Operators
An arithmetic operator performs mathematical
operations such as addition, subtraction and
multiplication on numerical values (constants
and variables).
Operator
Meaning of Operator
+
addition or unary plus
-
subtraction or unary minus
*
multiplication
/
division
%
remainder after division( modulo division).