Post: Math statement help (JAVA)
09-29-2013, 08:11 PM #1
Luffy*
i'M NoT goNNa LiE
(adsbygoogle = window.adsbygoogle || []).push({}); I'm practicing for my midterm, and I can't figure out what I'm doing wrong here:

Let A = 6. What is the value of B after the statement B = A + A + (A++) * 2.

The answer is 24, but I got 26 when I did it.

And also:

Let A = 2.
B = A++ + ++A + A * 2
(adsbygoogle = window.adsbygoogle || []).push({});
09-29-2013, 08:17 PM #2
Luffy*
i'M NoT goNNa LiE
Alright, I figured out the first one. A is incremented after the expression, so A would = 7, and B would = 24.
09-29-2013, 08:27 PM #3
Luffy*
i'M NoT goNNa LiE
Problem figured out. Close thread please.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo