Question:

What output will be produced by the code below?

let foo = 0x10
print(foo)

Correct answer: 16.

Explanation: Swift lets you declare numbers using 0x as a hexadecimal prefix. 0x10 is 16 in hexadecimal.


Keywords:

© 2017 QuizBucket.org