This commit is contained in:
Vieira Enzo 2021-10-05 15:07:50 +02:00
parent 367f0384d6
commit ab149abb2d
9 changed files with 127 additions and 0 deletions

BIN
Dev1.1/Dev2809/Devinette Executable file

Binary file not shown.

View File

@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
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;
}

12
Dev1.1/Dev2809/Figures.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int i;
int premier;
int add;
printf("Entrez un nombre premier :");
scanf("%d", &premier);
for (i=0;i<premier-1;i++) {

BIN
Dev1.1/Dev2809/Premier Executable file

Binary file not shown.

27
Dev1.1/Dev2809/Premier.C Normal file
View File

@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
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;
}
}
}

View File

@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
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 <terme+1;i++) {
if (i <= 1)
resultat = i;
else
{ resultat = nbr1 + nbr2;
nbr1 = nbr2;
nbr2 = resultat;}
}
printf("%d\n", resultat);
return EXIT_SUCCESS;
}

Binary file not shown.

View File

@ -0,0 +1,29 @@
#include <stdio.h>
#include <stdlib.h>
#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<TAILLE+1;i++){
printf("%3d ",i);
printf("|");
for (y = 0; y<TAILLE+1;y++){
printf("%3d ",i*y);}
printf("\n");
}
return EXIT_SUCCESS;
}

BIN
Dev1.1/Dev2809/progression Executable file

Binary file not shown.