diff --git a/main b/main new file mode 100755 index 0000000..de142a6 Binary files /dev/null and b/main differ diff --git a/main.c b/main.c index 4ba691a..4621e0d 100644 --- a/main.c +++ b/main.c @@ -1 +1,25 @@ -#include \n\nint main(){\n\n} +#include +#include + +typedef int bool; + +const int true = 1; +const int false = 0; + +int main(){ + int numero; + bool divisibile = false; + printf("Inserire un numero: "); + scanf("%i", &numero); + + for (int i = 2; i < numero - 1 && divisibile == false; i++){ + if(numero%i==0){ + divisibile = true; + printf("%i non è primo", numero); + } + } + if(divisibile==false){ + printf("Il numero è primo."); + } + return 0; +} \ No newline at end of file