Created
September 17, 2022 00:45
-
-
Save ashraf267/64cd688790c8b96d542d2559aae57d23 to your computer and use it in GitHub Desktop.
Modern problems, modern solutions :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
void print(int n); | |
int i; | |
for (i = 1; i <= 100; i++) { | |
if (i % 15 == 0) { | |
putchar('F'); | |
putchar('z'); | |
putchar('B'); | |
putchar('z'); | |
putchar(' '); | |
continue; | |
} else if (i % 3 == 0) { | |
putchar('F'); | |
putchar('z'); | |
putchar(' '); | |
continue; | |
} else if (i % 5 == 0) { | |
putchar('B'); | |
putchar('z'); | |
putchar(' '); | |
continue; | |
} | |
print(i); | |
} | |
} | |
void print(int n) { | |
if (n < 0) { | |
putchar('-'); | |
n = -n; | |
} | |
if (n / 10) { | |
print(n / 10); | |
} | |
putchar((n % 10) + '0'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment