Vidyalelo
Computer Science · Q151

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 151

Q151

Which line of code shows how to call a Fibonacci function, bypass the first three elements, grab the next six, and sort the elements in descending order?

A.
Val sorted = fibonacci().skip(3).take(6).sortedDescending().toList()
B.
Val sorted = fibonacci().skip(3).take(6).sortedByDescending().toList()
C.
Val sorted = fibonacci().skip(3).limit(6).sortedByDescending().toList()
D.
Val sorted = fibonacci().drop(3).take(6).sortedDescending().toList()
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board