Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B_141209_EsPrimo
//Title of this code #include <stdio.h> #include <math.h> short esPrimo(short p); int main(void) { short N; for(N = 1 ; N <= 100 ; N++) { if(esPrimo(N)) { printf("%4hd", N); } } return 0; } short esPrimo(short p) { if(p == 1 || p == 2) return 1; short d; for(d = 2 ; d <= sqrt(p) && p % d ; d++); return p % d; }
run
|
edit
|
history
|
help
0
BMI Calc CT
Conflito de Escrita em Matriz
eliminate_duplicates.c
Loop-worksharing
Calculate Area of Circle
variable arguments 2
C dynamic string implementation using preprocessor
Different variable scanf/printf statements
Hello
BigInteger maxMinSum