
Kotlin Output Quiz

Quiz
•
Computers
•
Professional Development
•
Hard
Nisha V
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? fun greet(name: String): String { return "Hello, $name" } fun main() { println(greet("Kotlin")) }
Hello Kotlin
Hello, Kotlin
greet(Kotlin)
Kotlin
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? fun sum(a: Int, b: Int): Int = a + b fun main() { val result = sum(10, 15) println(result) }
25
10 + 15
sum
0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? fun loopTest() { for (i in 1..3) { print(i) } } fun main() { loopTest() }
123
012
1 2 3
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? fun operate(a: Int, b: Int, op: (Int, Int) -> Int): Int { return op(a, b) } fun main() { val result = operate(3, 4) { x, y -> x * y } println(result) }
12
7
1
0
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? val square: (Int) -> Int = { it * it } fun main() { println(square(5)) }
25
10
5
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? fun compute(op: (Int) -> Int) { println(op(3)) } fun main() { compute { it + 10 } }
13
10
3
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? inline fun greet(block: () -> Unit) { println("Start") block() println("End") } fun main() { greet { println("Hello Inline") } }
Start Hello Inline End
Hello Inline
Start End
Error
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Repaso de Python

Quiz
•
5th Grade - Professio...
20 questions
OOP, access modifiers, properties

Quiz
•
Professional Development
20 questions
Revisão JAVA Básico

Quiz
•
Professional Development
16 questions
Final Assessment

Quiz
•
Professional Development
13 questions
Examen 2

Quiz
•
Professional Development
15 questions
CS402 T04

Quiz
•
Professional Development
15 questions
Konfigurasi bgp

Quiz
•
Professional Development
13 questions
Test z języka JAVA dla I klasy LO

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade