Skip to main content

Practice · 1 of 4

Evaluate before storing

CHALLENGE
Difficulty: beginner+25 XP

Implement int addThree(int x): return the value of x after three single +1 assignments — i.e. x + 3. Use exactly three assignment statements and the pattern x = x + 1;.

Back to lesson: Practice: Typed storage