- Call Us: +91 9437911966
- Email Us: [email protected]

C Tutorial
C Introduction
C Characteristic
C Comments
C Operator
C Assign Operator
C Arithmetic Oper..
C Logical Operator
C Modulus Operator
C Variable
C Initialise Variable
C Print F
C Translators
C Programming
C Control Flow
C If Else Statement
C Nested If Else
C Loops
C While Loops
C For Loops
C Do While
C Nested Loops

- Student Tutorial
- 08 jun 2020

When we required evaluating basic mathematical expressions then we required to use asthmatic operators.

- Unary arithmetic operators ++, --
- Binary arithmetic operators +, -, *, /, %

- When we are working with these operators we required 2 operands. If any one of the asg. Is missing it gives an error.
- In implementation when we are evaluating any expression if that expression contains multiple operators then in order to evaluate that expression we requires to follow priority of the operator.
- According to priority which operators are having highest priority it should be evaluate first, which operator contains least priority it should be evaluated at last?
- When equal priority is occurred, if it is binary left to right, if it is unary, right to left required evaluating.
- * / %
- + -
- =

```
A= 2+5; 7 (return values)
A=5+3-4; 4
8-4
A= 5-4+3; 4
1+3
A= 2*3+2*3; 12
6+6
A= 2+3*2+3; 11
2+6+3
A=5+; Error
A= 8-; Error
A= +5; 5
A=-8; -8
```

- When we are working with +, - symbols then it works like a binary and unary operator also.
- if the symbol is available before the operands then it is unary operators which indicate sign of the value.
- When the symbol is available after the operands then it is binary arithmetic operators .Which requires 2 arguments.
- Always expression required to evaluate acc. To operand type only.
- Always operator behaviour is operand depend only i.e. what type of data we are passing depends only on input type it works.
- If both arguments are integer then return value is int.
- Any one of the argument is float or both are float then return value is float type only.
- Output sign will depends on numerator value sign and determinate value also i.e. if any of the arguments is negative then return value is negative, if both arguments are return value is positive.
- In division operator when the numerator value is less than of denominator operator then return value is zero if both are integer.

Expression | Return Values |
---|---|

5/2 | 2 |

5.0/2 | 2.5 |

5/2.0 | 2.5 |

5.0/2.0 | 2.5 |

2/5 | 0 |

2.0/5 | 0.4 |

-5/2 | -2 |