Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What does the statement x += 3; do?
Think about how much x increases by.
If y = 10; and then y -= 2;, what is the value of y?
What is 10 minus 2?
What is the result of x = 10; x += 5;?
Think about how addition works here.
Using -= would result in what action?
Remember what subtraction does.
You have a variable int total = 100;. Write code that effectively reduces total by 40 using compound operators in one line.
Think about how to simplify the operation using the minus operator.
Consider int score = 10;. If you want to double the score using the compound operator mechanism, how would you express this? Write the code.
What operation gets you double the score?
5 more questions in this section. Enroll free to practise them all.
Enroll free