Skip to content
Snippets Groups Projects
Commit 44f6cddd authored by Liantsoa Sitrakiniavo Rakotomanana's avatar Liantsoa Sitrakiniavo Rakotomanana
Browse files

C ET DEBUGAGE

parent 9b147aac
No related branches found
No related tags found
No related merge requests found
code/Numbers.c 100644 → 100755
......@@ -4,20 +4,24 @@
#define TAILLE 50
/// Returns the prime numbers in `elements`.
void primes(int numbers[]) {
void primes(int numbers[]){
int i;
for (i=0; i<TAILLE; i++) {
bool isPrime = true;
int m;
for (m=1; m < numbers[i] ;m++) {
for (m=2; m < numbers[i] ;m++) {
if (numbers[i] % m == 0) {
isPrime = false;
break;
isPrime = false;
}
}
if (isPrime){
printf("%i est un nombre premier\n", numbers[i]);
}
if (isPrime)
printf("%i est un nombre premier\n", numbers[i]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment