What will i and j equal after the code below is executed? Explain answer. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What will i and j equal after the code below is executed? Explain answer.

int i = 5; int j = i++;

4th Dec 2017, 8:38 PM
Yash Kumar Singh
Yash Kumar Singh - avatar
1 Answer
0
i is initialized to 5, the 5 is stored in j, and i is incremented to become 6.
4th Dec 2017, 8:45 PM
John Wells
John Wells - avatar