Operators

What are the operators and the operands?


Example:
 1+2=5

Operators:

Here the symbol (+) which adds 1and 2 is called as an operator. So, the operator is the symbol used to perform the operation.
Operands: Here 1 & 2 are called as operands or data.

What operators can do?

An operator performs the operation for this they need data or operand. Without any operands, operators can not perform their operations.

There are several types of operators in C language/mathematics.
Before we understand Operators in C. First let us understand what is arithmetic instructions?

Arithmetic instruction:

It contains variables on the left side of = (Assignment operator) and variable names. Constants on right side of = (assignment operator).
An instruction which is used to manipulate(to change/control) data using operators, is known as Arithmetic operators.

Example:
 5+10*3
45 or 150

If you solve from left to right then your answer will be 45. But if you solve from right to left then your answer will be 150.
Now, the question in your mind arises that which one is the correct answer? 45 or 150?
To understand this concept you must have clear the concept of which operator you have to solve first. Because as there is a concept of BODMAS (Bracket Of Divison Multiplication Addition and Subtraction) precedence rule in Mathematics it is not applicable in C language.
This confusion comes when you have to tackle more than one operator.

To understand how to solve the above question or which is the correct answer stay tuned! And read our upcoming blog post...


What are the types of operators in C programming language?


  1. Unary Operators
  2. Arithmetic Operators
  3. Bitwise Operators
  4. Relational Operators
  5. Logical Operators
  6. Conditional Operator
  7. Assignment Operator



Comments

Popular posts from this blog

Getting input in C

Unary Operator