OneCompiler

Logical Operators & Assignment Operators in C Language

526

Logical Operators

C Language provides following three logical operators

OperatorDescription
&&Logical and
``
!Logical not

Assignment Operators

= is the Assignment operator in C Language, using this you can assign a value to a variable like following.

int age = 20;

Shorthand assignment operators

a = a + b; can also be written as a += b; These type of assignment operators are called as shorthand assignment operators.
Following is the full list of short hand assignment operators you can use.

Using normal assignment operatorUsing shorthand assignment operator
a = a + ba += b
a = a - ba -= b
a = a * ba *= b
a = a / ba /= b
a = a % ba %= b