Computer Science, asked by janemharriet, 2 months ago

i= ++i * 10 , where i=8 Find i

Answers

Answered by anindyaadhikari13
4

Solution:

Initially,

→ i = 8

After evaluation,

→ i = ++i * 10

As value of 'i' is pre incremented, So,

→ i = 9 * 10 (i becomes 9)

→ i = 90

So, the final value of 'i' is 90.

Answer:

  • i = 90

Extra Info:

Pre Increment/Decrement: When increment or decrement operator is used before the operand, it is known as prefix operation. In the given question, value of 'i' is pre-incremented. So, i becomes 9 first and then the operation takes place.

Post Increment/Decrement: This is just the opposite of prefix operators. Here, operation takes place before increment/decrement. For example,

a = 2

b = a++

Here, b = 2 as operation takes place first and then value of a is incremented.

So, a becomes 3 now.

•••♪

Similar questions