Home »
MCQs »
Scala MCQs
What is the output of the following block of code | Scala Question 13
89. What is the output of the following block of code -
object myObject {
def main(args: Array[String]) {
println(( div(mul(452)) ))
}
val mul = (a: Int)=> {
a * 100
}
val div = (a: Int) =>{
a / 500
}
}
- 45200
- 0
- 90
- Error
Answer: C) 90
Explanation:
Here, functions are used in composition and the result is an integer value that causes the loss in data.