October 2025
Intermediate to advanced
100 pages
2h 27m
English
| Puzzle 2 | Elvis in the Building |
| | fun main() { |
| | val bonus: Int? = 1000 |
| | val salary: Int = 50000 |
| | |
| | val total: Int = bonus ?: 0 + salary |
| | |
| | println("You got paid $total dollars!") |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess the output (or error) before moving to the next page. |
The program displays the following output:
| | You got paid 1000 dollars! |
Read now
Unlock full access