Bird
0
0

Which Kotlin number type should you use to store a whole number like 42?

easy📝 Conceptual Q11 of 15
Kotlin - Data Types
Which Kotlin number type should you use to store a whole number like 42?
AFloat
BDouble
CInt
DLong
Step-by-Step Solution
Solution:
  1. Step 1: Understand the number type categories

    Int is used for normal whole numbers without decimals.
  2. Step 2: Match the number 42 to the type

    42 is a whole number and fits in Int range.
  3. Final Answer:

    Int -> Option C
  4. Quick Check:

    Whole number 42 = Int [OK]
Quick Trick: Whole numbers without decimals use Int by default [OK]
Common Mistakes:
MISTAKES
  • Choosing Float or Double for whole numbers
  • Using Long unnecessarily for small numbers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes