0
As a newbie to kotlin, how can I solve this?
Write a short program that prints each number from 1 to 100 on a new line. For each multiple of 3, print "Fizz" instead of the number. For each multiple of 5, print "Buzz" instead of the number. For numbers which are multiples of both 3 and 5, print "FizzBuzz" instead of the number.
7 Respuestas
+ 2
https://code.sololearn.com/cEyOqvx922kO/?ref=app
https://code.sololearn.com/cTwoH2kjI4ri/?ref=app
https://code.sololearn.com/ca8A1A16a18A/?ref=app
https://code.sololearn.com/c0L77qvxCPHL/?ref=app
https://code.sololearn.com/cTcWK2O3Zv9a/?ref=app
https://code.sololearn.com/cQl14918jcpK/?ref=app
https://code.sololearn.com/ceBTGtxm3z5f/?ref=app
https://code.sololearn.com/cWeVLy51D7oz/?ref=app
+ 1
Blessing Ngozi Michael
As I can see your Kotlin course progress is 0 % so 1st start learning then solve this problem.
+ 1
I am currently taking a course in kotlin from a computer institute here and just need help with the above. I am not completely new to kotlin
+ 1
I will devote time to also improving myself via solo learn as well
+ 1
I am super grateful thanks, I will try out the code and leave a feedback.
0
Blessing Ngozi Michael
Use for loop and inside for loop check 3 condition
1 - number % 3 == 0 and number % 5 == 0
print FizzBuzz
2 - number % 3 == 0
print Fizz
3 - number % 5 == 0
print Buzz
0
Thanks everyone, its great having you guys here to help improve me. Best regards