Test: Swift - Floating Point Types
1. let price = 2.99 - What’s the type of price in Swift?
Congratulations! Correct Answer.
You Answered: None. If you took the test, your answer will show up here.
Correct Answer: Double
ExplanationThe type of price will be Double. Even though a smaller precision Float works here, Swift will choose Double via its Type Inference.
Take the TestTake the complete test on this topic. You will be able to review answers to questions and get a test score.
Take the Test
Question 1 of 5
Test is Based on this Article
More Articles With Similar Tags