DEV/DEV1.1/TP05/primarite.c

24 lines
318 B
C
Raw Normal View History

2022-10-04 17:30:38 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
int x = 0;
int i;
printf("Rentrer un entier: ");
scanf("%d",&x);
for(i = 1;i<x;i++) {
if (i==1){
printf("");
}
else {
if ((x%i)==0) {
printf("Pas premier");
i=2*x;
}
}
}
if(i!=(2*x)){
printf("Premier");
}
return EXIT_SUCCESS;
}