Computer Science, asked by Harshitsinha115, 9 months ago

Define increment and decrement operators and its use as well as give some examples????​

Answers

Answered by Anonymous
2

Increment and decrement operators are unary operators that add or subtract one, to or from their operand, respectively. They are commonly implemented in imperative programming languages. ... The increment operator increases, and the decrement operator decreases, the value of its operand by 1.

Answered by nikitarachel115
1

Answer:

increment and decrement operators are unary operators. In increment 1 is added to the value of the variable, for eg. i=2, ++i=(1+2)=3 [here first 1 is added to the variable then the value of the variable is taken] and i=2, i++=(2+1)=3 [here first the value of the variable is taken then 1 is added to the variable ].

In decrement 1 is substrated from the value of the variable, for eg. i=2, --i [first 1 is substrated from the value of the variable then the value is taken] and i--[here first the value of the variable is taken then 1 is substrated from the value of the variable].

Similar questions