Operators

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

operators

an operator is an special symbol which operate on a value or a variable.


eg;+is an operator to perform addition
classification of operator
1>unary
2>binary
3>ternary
1.unary
these operator are used on single operand.
eg; a++,a--
2. binary
these operator are used on two variable or operand,....
it can be divided into following categorie;;;
a> arithmetic
b> logical
c> assignment
d> bitwise
e> relational
a> arithemetic
arithemetic operator are used to perform mathematical calculation s like add
subtract multiply divide module etc
a+b
a-b
a*b
a/b
a%b
b> logical
these operators are used to perform logical operations all the given expression..
&& logicalAND
|| logical OR
(x>5)&(x<5)
it written when both conditions is true.
(x>5)||(x<5)
it written when atleast one condition is true...
c> assignment
in c program values for the variables are assign using thes operators
= sum=10;
+ sum+=10
- sum=-10;
& sum=&10
d> relational
these operators are used to find tyhe relation b/w two variables and to compare the
value of variables....
a<b
a>b
a>=b
a===b
e> bitwise
these operators are used to perform bit operations .
a b a/b a&b a^b
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 0
3> ternary
terary operator wriitten one value if condition is true and written another value
if conditin is false..
these operators are also known as conditional operators
eg; expression 1; exp[ression 2;
expression 3;

You might also like