Skip to main content
added 175 characters in body
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C (gcc), 14 13 bytes

f(n){n=n?:1;}

Thanks to @betseg for reminding me of the n?:1 trick in the comments of the other C answer!

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C, 16 bytes

#define f(n)!n+n

Try it online!

C (gcc), 14 13 bytes

f(n){n=n?:1;}

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C, 16 bytes

#define f(n)!n+n

Try it online!

C (gcc), 14 13 bytes

f(n){n=n?:1;}

Thanks to @betseg for reminding me of the n?:1 trick in the comments of the other C answer!

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C, 16 bytes

#define f(n)!n+n

Try it online!

added 175 characters in body
Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C (gcc), 1414 13 bytes

f(n){n=n?n:1;}

Try it online!Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C, 16 bytes

#define f(n)!n+n

Try it online!

C (gcc), 14 bytes

f(n){n=n?n:1;}

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C (gcc), 14 13 bytes

f(n){n=n?:1;}

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!

C, 16 bytes

#define f(n)!n+n

Try it online!

Source Link
Steadybox
  • 16.5k
  • 5
  • 41
  • 84

C (gcc), 14 bytes

f(n){n=n?n:1;}

Try it online!

C, 17 bytes

f(n){return!n+n;}

Try it online!