Bird
0
0

What will be the output of this Kotlin program?

medium📝 Predict Output Q13 of 15
Kotlin - Basics and JVM Runtime
What will be the output of this Kotlin program?
fun main() {
    println("Start")
    println("End")
}
AStart\nEnd
BEnd\nStart
CStart End
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Read the print statements order

    The program prints "Start" first, then "End" on separate lines.
  2. Step 2: Understand println behavior

    println adds a new line after each output, so outputs appear on separate lines.
  3. Final Answer:

    Start\nEnd -> Option A
  4. Quick Check:

    Print order matches output lines [OK]
Quick Trick: println prints with a new line after output [OK]
Common Mistakes:
MISTAKES
  • Assuming outputs print on same line
  • Mixing order of print statements
  • Thinking println does not add new line

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes