diff --git a/Dev1.1/Dev2809/Devinette b/Dev1.1/Dev2809/Devinette new file mode 100755 index 0000000..705e91d Binary files /dev/null and b/Dev1.1/Dev2809/Devinette differ diff --git a/Dev1.1/Dev2809/Devinette.c b/Dev1.1/Dev2809/Devinette.c new file mode 100644 index 0000000..6cb9778 --- /dev/null +++ b/Dev1.1/Dev2809/Devinette.c @@ -0,0 +1,34 @@ +#include +#include + +int main(void) { + +int i; +int chiffre = 0; +srand(time(NULL)); +int var = rand()%100+1 ; +for(i= 0; i < 5; i++){ + printf("rentrez un entier :"); + scanf("%d", &chiffre); + if (chiffre == var) { + printf("c'est le bon chiffre Bravo !\n"); + return EXIT_SUCCESS; } + if (chiffre > var) { + printf("-\n"); + }else{ + if (chiffre < var ) { + printf("+\n");} + } + } +printf("Le chiffre était : %d\n",var); + return EXIT_SUCCESS; +} + + + + + + + + + diff --git a/Dev1.1/Dev2809/Figures.c b/Dev1.1/Dev2809/Figures.c new file mode 100644 index 0000000..ea99435 --- /dev/null +++ b/Dev1.1/Dev2809/Figures.c @@ -0,0 +1,12 @@ +#include +#include + +int main(void){ + int i; + int premier; + int add; + printf("Entrez un nombre premier :"); + scanf("%d", &premier); + for (i=0;i +#include + +int main(void) { + +int i; +int chiffre = 0; +printf("rentrez un entier naturel :"); +scanf("%d", &chiffre); +if (chiffre == 0) { + printf("Erreur Chiffre nul \n"); +} +if (chiffre == 2 || chiffre == 1) { + printf("C'est un chiffre premier\n"); +} +for (i = 2; i < chiffre;i++) { + if (chiffre % i == 0) { + printf("Ce n'est pas un nombre premier\n"); + return EXIT_SUCCESS; + }else{ + printf("C'est un nombre premier\n"); + return EXIT_SUCCESS; +} +} +} + + diff --git a/Dev1.1/Dev2809/Progression.c b/Dev1.1/Dev2809/Progression.c new file mode 100644 index 0000000..ba21e1c --- /dev/null +++ b/Dev1.1/Dev2809/Progression.c @@ -0,0 +1,25 @@ +#include +#include + +int main(void) { + int i; + int terme; + int resultat; + int nbr1 = 0; + int nbr2 = 1; + printf("Quel terme voulez vous ? :"); + scanf("%d",&terme); + for (i = 0; i +#include +#define TAILLE 11 + +int main(void) { + int i; + int y; + printf(" X |"); + for ( i = 0; i < TAILLE+1;i++){ + printf("%3d ",i); + } + printf("\n"); + printf("-----+"); + for (i = 0;i< TAILLE+1;i++){ + printf("-----"); + } + printf("\n"); + for ( i = 0;i