This one compiles but gives me an error when I execute it.
Itīs supposed to return 0 if a number is prime and 1 if itīs not.
Translation form spanish:
esprimo=isprime
ingrese un entero=input an integer
thank you!!!!Code:#include <stdio.h> #include <stdlib.h> int main() { int n; printf("Ingrese un entero: "); scanf("%d",n); printf("%d",esprimo(n)); system("PAUSE"); return 0; } int esprimo(int n) { int i; i=2; while(n%i!=0) i++; if(i<n) return 0; else return 1; }