559 views

1 Answer

Best answer
4 4 votes
a = 1, b = 2. The following are equivalent.

a+=++b;

a = a + ++b

a = a + (b = b+ 1)

So, b = 3, a = 4.
• selected by
Position:
Show:

Related questions

1 1 vote
0 0 answers
53
53 views
khanshahima4 asked 1 day ago
53 views
1. If precedence tells me which operator has priority, and associativity tells me how to handle operators at the same level, then why do I need a separate concept called ...
13 13 votes
1 1 answer
1.2k
1.2k views
GO Classes asked Jul 2
1,197 views
Assume:$\texttt{short = 2 bytes}$, $\texttt{int = 4 bytes}$, $\texttt{char = 1 byte}$$\texttt{int}$ needs $4$-byte alignment and the final structure size is rounded to a ...
15 15 votes
2 2 answers
640
640 views
GO Classes asked Jul 2
640 views
Assume:struct Student { double gpa; }; struct Student alice; struct Student *sptr = &alice;Which of the following correctly assigns $\texttt{4.0}$ to $\texttt{alice.gpa}$...
9 9 votes
1 1 answer
478
478 views
GO Classes asked Jul 2
478 views
Consider the following code idea from the source:typedef struct { double x, y; } Point; void reset(Point p) { p.x = p.y = 0; } int main() { Point a = {12.0, 42.0}; Point ...