Q:

Write a program in kotlin to print the following statment 10 times

belongs to collection: Kotlin programming Exercises

0

Write a program in kotlin to print the following statment 10 times

n. Practice makes a man perfect.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

fun main(args : Array<String>)  {  
	repeat(10) { i ->
	println("${i + 1}. Practice makes a man perfect.")
	}
}

Output:

1. Practice makes a man perfect.
2. Practice makes a man perfect.
3. Practice makes a man perfect.
4. Practice makes a man perfect.
5. Practice makes a man perfect.
6. Practice makes a man perfect.
7. Practice makes a man perfect.
8. Practice makes a man perfect.
9. Practice makes a man perfect.
10. Practice makes a man perfect.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a program in kotlin to iterate over the foll... >>
<< Write a Kotlin program to create an array of size ...