Post History
C (gcc), 20 bytes f(a){puts("!"+a%2);} Try it online! Function solution. Prints ! in case of even numbers, otherwise just new line.
Answer
#2: Post edited
# [C (gcc)], 22 bytes- <!-- language-all: lang-c -->
f(a){putchar(a%2<<6);}[Try it online!][TIO-kqhqvcl1]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kqhqvcl1]: https://tio.run/##S9ZNT07@r5yZl5xTmpKqYFNckpKZr5dh9z9NI1GzuqC0JDkjsUgjUdXIxsZM07r2f2ZeiUJuYmaehiZXNZeCQpqGoaY1mDYC0rX/AQ "C (gcc) – Try It Online"Function solution. Prints `@` in case of odd numbers, otherwise nothing (prints the null terminator).Strictly conforming version, 31 bytes:void f(int a){putchar(a%2<<6);}
- # [C (gcc)], 20 bytes
- <!-- language-all: lang-c -->
- f(a){puts("!"+a%2);}
- [Try it online!][TIO-kqi46axl]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kqi46axl]: https://tio.run/##S9ZNT07@r5yZl5xTmpKqYFNckpKZr5dh9z9NI1GzuqC0pFhDSVFJO1HVSNO69n9mXolCbmJmnoYmVzWXgkKahqGmNZg2gtLGUNoESNf@BwA "C (gcc) – Try It Online"
- Function solution. Prints `!` in case of even numbers, otherwise just new line.
#1: Initial revision
# [C (gcc)], 22 bytes <!-- language-all: lang-c --> f(a){putchar(a%2<<6);} [Try it online!][TIO-kqhqvcl1] [C (gcc)]: https://gcc.gnu.org/ [TIO-kqhqvcl1]: https://tio.run/##S9ZNT07@r5yZl5xTmpKqYFNckpKZr5dh9z9NI1GzuqC0JDkjsUgjUdXIxsZM07r2f2ZeiUJuYmaehiZXNZeCQpqGoaY1mDYC0rX/AQ "C (gcc) – Try It Online" Function solution. Prints `@` in case of odd numbers, otherwise nothing (prints the null terminator). Strictly conforming version, 31 bytes: void f(int a){putchar(a%2<<6);}