Kotlin Basic Programs for Beginners
Kotlin Basic Programs for Beginners - Important Points
1. | What is the output of the following Kotlin code? fun main() { |
---|
A. null
B. 5
C. Compilation error
D. Runtime error
View Answer Discuss Work SpaceAnswer: option b
Explanation:
2. | What is the output of the following Kotlin code? fun main() { |
---|
A. num1 is greater than num2
B. num2 is greater than num1
C. Both num1 and num2 are equal
D. Compilation error
View Answer Discuss Work SpaceAnswer: option b
Explanation:
3. | What is the output of the following Kotlin code? fun main() { |
---|
A. 1 2 3 4 5
B. 1 3 5
C. 2 4
D. Compilation error
View Answer Discuss Work SpaceAnswer: option b
Explanation:
4. | What is the output of the following Kotlin code? fun main() { |
---|
A. Compilation error
B. Runtime error
C. Hello, world!
D. Hello, world! (printed 5 times)
View Answer Discuss Work SpaceAnswer: option d
Explanation:
5. | What is the output of the following Kotlin code? fun main() { |
---|
A. null
B. -1
C. Compilation error
D. Runtime error
View Answer Discuss Work SpaceAnswer: option b
Explanation: