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.

20th Jun 2021, 3:04 PM
Blessing Ngozi Michael
7 odpowiedzi
+ 1
Blessing Ngozi Michael As I can see your Kotlin course progress is 0 % so 1st start learning then solve this problem.
20th Jun 2021, 3:05 PM
A͢J
A͢J - avatar
+ 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
20th Jun 2021, 3:08 PM
Blessing Ngozi Michael
+ 1
I will devote time to also improving myself via solo learn as well
20th Jun 2021, 3:09 PM
Blessing Ngozi Michael
+ 1
I am super grateful thanks, I will try out the code and leave a feedback.
20th Jun 2021, 3:15 PM
Blessing Ngozi Michael
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
20th Jun 2021, 3:13 PM
A͢J
A͢J - avatar
0
Thanks everyone, its great having you guys here to help improve me. Best regards
11th Jul 2021, 12:58 AM
Blessing Ngozi Michael