**Assignment operators-: **Assignment operators are used to assign the result of an expression to a variable. We have seen the usual assignment operators “= “. C has a set of shorthand assignment operators of the form as like s op= exp ;

where s is a variable, exp is an expression and op is a c binary arithmetic operators op=OP.

assignment operators

- a=a+1
- a=a-1
- a=a*(n+1)
- a=a/(n+1)
- a=a%n

The assignment has some advantage here

- What appears on the left hand side need not be repeated and therefore it becomes easier to writing.
- The statement is easy to read
- statement is more efficient

Example -: We write a program here

#define N 100 #define A 2

main()

{

int x;

x=A;

while (x<N)

{

printf(“%d\n”,x);

x*=x;

}

}

Output is

2

4

16