Recall & Review
beginner
What are arithmetic operators in Kotlin?
Arithmetic operators are symbols that perform basic math operations like addition, subtraction, multiplication, division, and modulus on numbers.
Click to reveal answer
beginner
What does the '+' operator do in Kotlin?
The '+' operator adds two numbers together. For example, 3 + 2 equals 5.
Click to reveal answer
beginner
What is the result of 10 % 3 in Kotlin?
The '%' operator gives the remainder of division. 10 % 3 equals 1 because 3 goes into 10 three times with 1 left over.
Click to reveal answer
intermediate
How does Kotlin handle division with '/' operator for integers?
When dividing two integers, Kotlin performs integer division, which means it returns the whole number part only, discarding any remainder.
Click to reveal answer
beginner
What is the difference between '/' and '%' operators in Kotlin?
'/' divides two numbers and returns the quotient, while '%' returns the remainder after division.
Click to reveal answer
What is the result of 7 + 5 in Kotlin?
✗ Incorrect
7 + 5 adds the two numbers to get 12.
What does the '%' operator do?
✗ Incorrect
The '%' operator returns the remainder after dividing two numbers.
What is the output of 10 / 4 in Kotlin when both are integers?
✗ Incorrect
Integer division discards the decimal part, so 10 / 4 equals 2.
Which operator multiplies two numbers?
✗ Incorrect
The '*' operator multiplies two numbers.
What is the result of 15 % 6?
✗ Incorrect
15 divided by 6 is 2 with a remainder of 3, so 15 % 6 equals 3.
Explain the five basic arithmetic operators in Kotlin and give an example of each.
Think about +, -, *, /, and % symbols.
You got /6 concepts.
Describe how Kotlin handles division when both numbers are integers.
What happens to the decimal part?
You got /3 concepts.