Post History
C (gcc), 53 bytes This uses the shortcut behaviour of logical or (||) to only multiply if it is a divisor; the loop end condition then makes sure it's a proper divisor. i=1;p=1;f(n){for(;i<n...
Answer
#1: Initial revision
# [C (gcc)], 53 bytes This uses the shortcut behaviour of logical or (`||`) to only multiply if it is a divisor; the loop end condition then makes sure it's a proper divisor. <!-- language-all: lang-c --> i=1;p=1;f(n){for(;i<n;++i)(n%i)||(p*=i);return p==n;} [Try it online!][TIO-m20pkvq7] [C (gcc)]: https://gcc.gnu.org/ [TIO-m20pkvq7]: https://tio.run/##LY1BCsIwFET3OcUnUkhsFerSNHoRNzVN9EP7G9Jk1fbsMYqLgZnHgzGnlzE5o26VL3GC5OrmIBR2pOoapaAK5bYJf9QoVbAxBQKvNak9H5DMmAYL3RIHnM/vG2NIEaYeSUi2MoDvpDQ9bQANl1YV5EOBTvBqgCtUy4N481caKP@/Ju/AY0iWF4W7flwsl4rt@QM "C (gcc) – Try It Online"