Computer Science, asked by sujathagowtham144, 3 months ago

what is the function of increment/decrement operators how many varieties do they come in how are these two varieties different from one another

WRONG ANSWER WILL BE REPORTED

Answers

Answered by hatimmithaiwala786
4

Answer:

The increment operator, ++ adds 1 to its operand and the decrement operator -- subtract 1 from its operands. The increment/decrement operator comes in two varieties as following: (i) Prefix version and (ii) Postfix version: Prefix version Postfix version Performs the increment or decrement operation before using the value of the operand. First uses the value of the operand in evaluating the expression before incrementing or decrementing the operand’s value Example: sum = 10; ctr = 5; sum = sum + (++ctr); Example sum = 10; ctr = 5; sum = sum + (ctr++).

Similar questions