DEV
This commit is contained in:
parent
ab149abb2d
commit
fdb06e9ab9
BIN
Dev1.1/Dev0510/Affluence
Executable file
BIN
Dev1.1/Dev0510/Affluence
Executable file
Binary file not shown.
22
Dev1.1/Dev0510/Affluence.c
Normal file
22
Dev1.1/Dev0510/Affluence.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
int lundi,mardi,mercredi,jeudi,vendredi;
|
||||
int total;
|
||||
float moyenne;
|
||||
printf("Nombre visiteurs lundi : ");
|
||||
scanf("%d",&lundi);
|
||||
printf("Nombre visiteurs mardi : ");
|
||||
scanf("%d",&mardi);
|
||||
printf("Nombre visiteurs mercredi : ");
|
||||
scanf("%d",&mercredi);
|
||||
printf("Nombre visiteurs jeudi : ");
|
||||
scanf("%d",&jeudi);
|
||||
printf("Nombre visiteurs vendredi : ");
|
||||
scanf("%d",&vendredi);
|
||||
total = lundi + mardi + mercredi + jeudi + vendredi;
|
||||
moyenne =(float) total/5;
|
||||
printf("moyenne d'affluence : %f\n", moyenne);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
12
Dev1.1/Dev0510/Debordement.c
Normal file
12
Dev1.1/Dev0510/Debordement.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int entier;
|
||||
char entierchar;
|
||||
printf("Entrez un entier : ");
|
||||
scanf("%d",&entier);
|
||||
entierchar = (char) entier;
|
||||
printf("%c\n",entierchar);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
Dev1.1/Dev0510/Débordement
Executable file
BIN
Dev1.1/Dev0510/Débordement
Executable file
Binary file not shown.
BIN
Dev1.1/Dev0510/Monnaie
Executable file
BIN
Dev1.1/Dev0510/Monnaie
Executable file
Binary file not shown.
33
Dev1.1/Dev0510/Monnaie.c
Normal file
33
Dev1.1/Dev0510/Monnaie.c
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void){
|
||||
int piece = 2;
|
||||
float vingt = 0.2;
|
||||
float un = 0.01;
|
||||
float prix;
|
||||
int nombre_piece = 0;
|
||||
int nombre_vingt = 0;
|
||||
int nombre_un = 0;
|
||||
float paiement;
|
||||
printf("Combien avez vous payé ? :");
|
||||
scanf("%f",&prix);
|
||||
paiement = prix - 5.49;
|
||||
while(paiement >= 2) {
|
||||
nombre_piece = nombre_piece + 1;
|
||||
paiement = paiement - 2.0;
|
||||
}
|
||||
while (paiement > 0.2){
|
||||
nombre_vingt = nombre_vingt + 1;
|
||||
paiement = paiement - 0.2;
|
||||
}
|
||||
while (paiement > 0.01){
|
||||
paiement = paiement - 0.01;
|
||||
nombre_un = nombre_un+1;
|
||||
}
|
||||
|
||||
printf("nombre de piece de 2 à rendre : %d\n",nombre_piece);
|
||||
printf("nombre de piece de vingt centimes à rendre %d\n",nombre_vingt);
|
||||
printf("nombre de piece de un à rendre : %d\n",nombre_un);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
Dev1.1/Dev0510/Variété
Executable file
BIN
Dev1.1/Dev0510/Variété
Executable file
Binary file not shown.
22
Dev1.1/Dev0510/Variété.c
Normal file
22
Dev1.1/Dev0510/Variété.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
printf("%c%c\n",'7','7' );
|
||||
printf("%hhu\n",77);
|
||||
printf("%hd\n", 77);
|
||||
printf("%hu\n",77);
|
||||
printf("%d\n",77);
|
||||
printf("%u\n",77U);
|
||||
printf("%ld\n",77L);
|
||||
printf("%lu\n",77UL);
|
||||
printf("%lld\n",77LL);
|
||||
printf("%llu\n",77ULL);
|
||||
printf("%f\n",77.0f);
|
||||
printf("%lf\n",77);
|
||||
printf("%Lf\n",77.0L);
|
||||
printf("%hhd\n",'M');
|
||||
printf("%c%c\n",55,55);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user