Non si sa come, ma funziona

This commit is contained in:
La Programmatrice Verde 2025-04-11 16:03:05 +02:00
parent 4fad4e619c
commit dcfef6f946
2 changed files with 25 additions and 1 deletions

BIN
main Executable file

Binary file not shown.

26
main.c
View File

@ -1 +1,25 @@
#include <stdio.h>\n\nint main(){\n\n} #include <stdio.h>
#include <stdlib.h>
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;
}