Operator In Programming Language
An Operator is a symbol that tells the compiler to perform specific mathematical.
Types Of Operator
- Arithmetic Operator
- Relational Operator
- Logical Operator
- Assignment Operator
Operator- +
Description- Adds two operands
Example- x + y will give 30
Operator Type- +, -, *, /, %
Logical Operator
Operator- &&
Description- Logical AND Operator If both the condition are true, only then the result is true, otherwise false.
Example- ((x>10) && (y=20))
Result- False
Operator Type-(||= Logical OR Operator), (!= Logical NOT Operator)
Assignment Operator
Operator- =
Description- Simple assignment operator, assigns values from right side operands to left side operand
Example- C= A + B will assign value of A + B into C
Relational Operator
Operator- ==
Description- Checks if the values of two operands are equal. If yes, the condition becomes true.
Example- (x==y)
Result- False
Operator Type- ( != - Check if the value of two operands are equal. If values are not equals, the condition becomes true), ( > - Checks if the value of left operands is greater than the value of right operands. If yes, the condition becomes, True), (< - Checks if the value of left operands is less than the value of right operand. If yes, the condition becomes true.), (>= - Checks if the value of left operands is greater is greater than or equal to the value of right operand. If yes, the condition becomes True.), (<= - Checks if the value of left operands is less than or equal to to the value of right operands. If yes, the condition becomes true.)
Very nice post
ReplyDelete