Bird
0
0

What will be the output of the following Kotlin code?

medium📝 Predict Output Q4 of 15
Kotlin - Operators and Expressions
What will be the output of the following Kotlin code?
val a = 15
val b = 10
println(a <= b)
Afalse
Btrue
C15
D10
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate the comparison a <= b

    Since 15 is not less than or equal to 10, the expression a <= b is false.
  2. Step 2: Determine the output of println

    The println will print the boolean result, which is false.
  3. Final Answer:

    false -> Option A
  4. Quick Check:

    Comparison a <= b = false [OK]
Quick Trick: Check values carefully for <= operator [OK]
Common Mistakes:
MISTAKES
  • Assuming 15 <= 10 is true
  • Confusing output with variable values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes