3. b
a
OPERATORS
An Operator is a symbol that specifies an operation to
be specified to be performed on the operands.
Some operators require two operands called binary
operators, while other acts upon only one operand
called unary operator.
The operators usually form a part of mathematical or
logical expression.
+
Second
Operand
First
Operand
Operator
6. PROGRAM :
#include<stdio.h>
int main()
{
int x = 5, y = 7, z;
z = x + y;
printf(“The value of x is: %dn”, x);
printf(“The value of y is: %dn”, y);
printf(“Their sum, z, is: %dn”, z);
return 0;
}
7. // Declaring & Defining the values
// main function
// Addition
// Subtraction
// Multiplication
// Division
// Modulus
Format Specifier
New line To get output
23. PRECEDENCE & ASSOCIATIVITY
What is Precedence?
C has a precedence associated with it. This precedence is
used to determine how an expression involving more than
one operator is evaluated.
What is Associativity?
The operators at higher level of precedence are
evaluated first.
The operators of the same precedence are evaluated either
from ‘left to right’ or from ‘right to left’ depending on the
level. This is known as the associativity property of an
operator.
24. Precedence rules decides the order in which
different operators are applied.
Associativity rule decides the order in which multiple
occurrences of the same level operator are applied.
C Operators with their Precedence & Associativity are
listed in the following table.