Skip to content

Instantly share code, notes, and snippets.

@ashraf267
Created September 17, 2022 00:45
Show Gist options
  • Save ashraf267/64cd688790c8b96d542d2559aae57d23 to your computer and use it in GitHub Desktop.
Save ashraf267/64cd688790c8b96d542d2559aae57d23 to your computer and use it in GitHub Desktop.
Modern problems, modern solutions :)
#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