Vidyalelo
Computer Science · Q145

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 145

Q145

You are writing a console app in Kotlin that processes test entered by the user. If the user enters an empty string, the program exits. Which kind of loop would work best for this app? Keep in mind that the loop is entered at least once

A.
a do..while loop
Answer
B.
a for loop
C.
a while loop
D.
a forEach loop

Answer: Option A

Solution

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