C++ Operators

Operators are symbols that help us perform mathematical and logical operations on operands. Operators are used to perform operations on variables and constants.A list of C++ operators are given below.

Prefix increment

++

Prefix decrement

One’s complement

~

Logical not

!

Unary negation

Unary plus

+

Multiplication

*

Division

/

Modulus

%

Addition

+

Subtraction

Less than

<

Greater than

>

Less than or equal to

<=

Greater than or equal to

>=

Equality

==

Inequality

!=

&&

logical AND

||

logical OR

!

logical NOT

a+=b

a=a+b

a-=b

a=a-b

a*=b

a=a*b

  • There is no operator for exponents. There are library functions instead.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: