May 20, 2024

Telugu Tech Tuts

TimeComputers.in

C language in telugu videos Increment and Decrement operators Part15

c language in telugu videos

The increment operator ++ adds 1 to its operand, and the decrement operator — subtracts 1 from its operand. Thus:

Increment and Decrement operators
Increment operators (++)

Increment operators are increase the value of subsequent. value may be increase according to the programmer.
Increment operator are two types as follows :
Post increment
Pre increment

Decrement operators ( — )

decrement operators decrease the value to one, two and so on.
As like Increment operators, decrement operators are also two type as :
Post decrement
Pre decrement

Before we more discuss about increment and decrement operator, let understand some expression; that’s are using in all operators.

Now some issues of pre and post increment and decrement, we will discuss after solve following programming :

x = 5 x = 5 x = 5
x = x+1 ++x x++
x = 6 x = 6 x=5

In above program u notice that value of x increase to one in all three expression but after the increasing one, the final value of x in not same, third box result is differ to another two boxes. Now you know that c operators are mostly three types, ++ and — operators are Unary operators.

Post increment or decrement are lowest precedence so it is solve at the end of program. Hence above program in third box first value of x is print i.e. 5 after, it is increase.