This commit is contained in:
Le Stagiaire
2024-11-19 15:11:05 +01:00
parent f56d985cad
commit 838f7415fb
7 changed files with 148 additions and 3 deletions

33
CPP/Source8.cpp Normal file
View File

@ -0,0 +1,33 @@
/*
* Programme de calcul des nombres premiers
* Par Florian Goussot
* BTS CIEL 2e ann<6E>e
* Fait le 05/11/2024 <20> Nancy
*/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int main(void) {
do {
system("cls");
printf_s("\t\t\tProgramme de calcul des nombres premiers\n");
printf_s("Donnez le nombre limite (>3) : ");
int nombres_premiers[100];
int limite = 3;
scanf_s("%d", &limite);
for (int i = 0; i <= limite; i++) {
int nb_diviseurs = 0;
for (int j = 2; j <= i; j++) {
if (i % j == 1) {
nb_diviseurs++;
}
}
if (nb_diviseurs == 1) {
}
}
printf_s("\n\nAppuyez sur Echap pour quitter...");
} while (_getch() != 27);
return 0;
}