Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For each of the following C++ code segments, show the values of the indicated va

ID: 3826392 • Letter: F

Question

For each of the following C++ code segments, show the values of the indicated variables after the statements in the code segment have been executed. Assume that both i and j are int variables. (a) i = 2; j = ++i * 2 + 1; Value of i:___ Value of j:____ (b) i = 2; j = 3 * i -- + 1; Value of i:____ Value of j:____ (c) i = 2; j = i >= 2 ? i++: i--; Value of i:____ Value of j:____ (d) i = 2; i %= 5; Value of i:____ (e) i = 2; j = (i -= 2) + 1; Value of i:____ Value of j:____ (f) i = (int) 3.15/1.5; Value of i:___

Explanation / Answer

a)

Value of i = 3 ,Value of j = 7

b)

Value of i = 1,Value of j = 7

c)

Value of i = 3 ,Value of j = 2

d)

Value of i = 2

e)

Value of i = 0 ,Value of j = 1

f)

Value of i = 2

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote