Computer Science, asked by kamleshchandra603, 1 month ago

r=5 then find with equal to v= r++ + 2*r+ 2*r++. find v and r. in java​

Answers

Answered by ArpitMishra506
0

Answer:

v = 29

r = 7

Explanation:

v = r++ + 2*r + 2*r++

v = 5 + 2*6 + 2*6

v = 5 + 12 + 12

v = 29

r = 7

.

.

.

.

HOPE THIS HELPS YOU FRIEND

Answered by BrainlyProgrammer
1

Answer:

Currently r=5

v=r++ + 2*r +2*r++

Note :-

r++ it's a postfix increment which means "first calculate then increase your value"

So

v=r++ + 2*r +2*r++

= 5 + 2*r + 2*r++ //now r turns 6

= 5+ 2*6+ 2*r++ //r is still 6..no change in value

= 5+ 2*6 + 2* 6 //Now r turns 7

= 5+ 12 + 12

= 5 +24

= 29

Correct Answer:-

  • v=29
  • r=7
Similar questions