1. PRESENTED TO:- IEBC
business college
PRESENTED BY:- AMLENDU KUMAR DUBEY.
bca 2nd year
Ideal eyes
A
PRESENTATION
ON
OPERATORS
2. OPERATOR
•An operator indicates an operation to be performed on
data that viewed a value. Using various operators in ‘C’
one can link the Variable.
OPERAND
An operand is a data item on which operators perform the
operation .’C’ is which in the use of different operators.
4. Arithmetic operator
An Arithmetic operator is a symbol which perform an Arithmetic operator
namely Addition,Multiplication,Subtraction,Division,Remainder .
All the Arithmetical operator are binary operator since they operate two
operands at a time.
Operator Symbol from
A. Addition + X+Y
B. Multiplication * X*Y
C. Subtraction - X-Y
D. Division / X/Y
E. Remainder % X%Y
Program
6. Binary arithmetic operator
These arithmetic Operator are used for numerical calculation between the
two constant value. They are also called as Binary Arithmetic Operator.
Explain Sign Example
Addition + 2+2= 4
Subtraction - 4-2=2
Multiplication * 2*2=4
Division / 4/2=2
7. Unary arithmetic operator
The operators which require only one operand are called unary arithmetic
operator. Unary Arithmetic Operator are increment(++) , decrement (--) and minus(-).
Operator Description or Action
++ Increment
-- Decrement
- Minus
& Address operator
sizeof Gives the size of on operator
Minus (-):- unary minus is used for indicating or changing the algebraic sign of a value.
Example:- x= -10; y= -x;
8. Relational operator
Relational operator such as greater then (>) or less then (<) are
used to compare values between two variables and thus from
relational expressions.
The relational operator expressions give the value “1” for TRUE result and the value
“0” for FALSE result.
1) Greater then “>”
2) Greater then equal “>=”
3) Less then “<”
4) Less then equal “<=”
5) Equal “==”
6) Not equal “!=”
Program
9. Logical operator
The logical relationship between the two expression are checked
with logical operator. Using these operators two expression can be
joined. After checking the condition it provides logical true (1) or
False(0) .
I. AND &&
II. OR ||
III. NOT !
10. Logical gate
AND GATE
x Y Z
0 0 0
0 1 0
1 1 1
OR GATE
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
NOT GATE
X Y Z
0 0 1
1 0 0
0 1 0
1 1 0
11. Increment and decrement operator
The increment and decrement operator in C are represented by
“++” and “- -” sign respectively. The operator “++” means “add
1” and the operator “- -” means “subtract 1” .
Expression:-
Increment Decrement
a=a+1; a=a-1;
or or
a++; a- -;
12. Assignment operator
The Assignment operator is represented by the equal sign ”=”.The variable appearing
On the left side of “=” sign and it is assigned the value appearing on the right side
Of this sign.
Assignment Statement Format
Variable_name= Expression;
Assignment operator symbol
= *= /= %= += -= <<= >>= >>>= &=
!= ^=
13. Conditional operator
The conditional operator contains condition followed by two statement or values.
If the condition is true, the first statement is executed , otherwise the second
statement is executed. The condition operator is also called the ternary operator
became they take three arguments .
Syntax:
Condition ? (expression1) : (expression2) ;
Program Conditional Operator
void main()
{
3>2 ? Printf(“True”) : printf(“False”) ;
}
Output:
True