24 lines
318 B
C
24 lines
318 B
C
#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;
|
|
} |