0

Please any explain me, why total 38 in here

int x = 1, y, total = 0; for (x=4; total < 36; x = x - 1){ y = x * x; total = total + x + y; } System.out.printf(“The total is: %d”, total); Total=38

9th Jun 2019, 6:21 AM
Хэрлэн Бат
Хэрлэн Бат - avatar
2 Answers
+ 1
Check out this helper code - I added console prints that should clear things up Included comments for clarification https://code.sololearn.com/cU2N7lVD0Tq2/?ref=app
9th Jun 2019, 6:32 AM
HNNX 🐿
HNNX 🐿 - avatar
0
Tnx a lot🙏🙏
9th Jun 2019, 7:38 AM
Хэрлэн Бат
Хэрлэн Бат - avatar