Posted By:
2 Jul, 2013 4:50 am PDT

Operators in C++.

What do you mean by operators? What are the different operators available in C++?
Attachment:None


Once we know the existence of constants and variables, we can start operating on them. We use the standard symbols available on the keyboard to perform the required operation. For example if we want to add a=5 with b=2 we just use the expression a+b to do the required task. There are different operators available in C++.They are as follows :

 

Assignment (=)

The assignment operator assigns a value to a variable.

 

Arithmetic operators 

Addition (+)

Subtraction (-)

Multiplication (*)

Division (/)

 Modulo (%).

 

These operators are used for the basic mathematical calculation.

 

Relational operators

Less than (<)

Less than equal to (<=)

Greater than (>)

Greater than equal to (>=)

equality (==)

not equal to (!=).

 

These operators are used in order to evaluate the comparison between two expressions or variables. And these operators return either True or False.

 

Logical operators

And (&&)

Or (||)

Not (!)

 

The logical operators && and || are used when evaluating two expressions to obtain a relational result. The && operator return True if both the operands are True else it returns False. The || operator returns False if both the operands are False else it returns True. The ! operators have only one operand and it returns the 'not' of the operand.

Was it useful?  




Please login to reply to this problem.



Related Problems on Fixoncloud