A collection of small C shared libraries implementing common number-property checks.
- Armstrong number check
- Palindrome number check
- Perfect number check
- Prime number check
- Strong number check
gcc -c -fPIC armstrong.c -o armstrong.o
gcc -shared -o libarmstrong.so armstrong.o#include "armstrong.h"
int main() {
if (armstrong(153)) {
// number is armstrong
}
return 0;
}Compile with:
gcc main.c -L. -larmstrong -o main