diff --git a/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge0.kt b/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge0.kt index ecbae5ecd..0bb04e133 100644 --- a/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge0.kt +++ b/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge0.kt @@ -19,19 +19,36 @@ package com.mouredev.weeklychallenge2022 * */ -fun main() { +#include +#include - for (index in 1..100) { - val divisibleByThree = index % 3 == 0 - val divisibleByFive = index % 5 == 0 - if (divisibleByThree && divisibleByFive) { - println("fizzbuzz") - } else if (divisibleByThree) { - println("fizz") - } else if (divisibleByFive) { - println("buzz") - } else { - println(index) +int main() +{ + int i; + + for(i=1; i<101; i++) + { + if(((i%3)==0) && ((i%5)==0)) + { + printf("fizzbuzz\n"); + } + else + { + if((i % 3) == 0) + { + printf("fizz\n"); + } + else + { + if((i % 5) == 0) + { + printf("buzz\n"); + } + else + { + printf("%d\n", i); + } + } } } -} \ No newline at end of file +}