
Kotlin Output Quiz
Authored by Nisha V
Computers
Professional Development

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Menerapkan Design Brief
Quiz
•
Professional Development
20 questions
PLC
Quiz
•
12th Grade - Professi...
20 questions
Module 1 Exercise (Python)
Quiz
•
Professional Development
20 questions
Python
Quiz
•
Professional Development
15 questions
image processing quiz2
Quiz
•
University - Professi...
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
13 questions
Javascript HTML CSS
Quiz
•
Professional Development
20 questions
java revews
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
15 questions
LOTE_SPN2 5WEEK3 Day 2 Itinerary
Quiz
•
Professional Development
20 questions
Black History Month Trivia Game #1
Quiz
•
Professional Development
20 questions
90s Cartoons
Quiz
•
Professional Development
42 questions
LOTE_SPN2 5WEEK2 Day 4 We They Actividad 3
Quiz
•
Professional Development
6 questions
Copy of G5_U6_L3_22-23
Lesson
•
KG - Professional Dev...
20 questions
Employability Skills
Quiz
•
Professional Development