Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <stdlib.h>
 
float Francs(float nombre)
{
     float resultat = 0;
     resultat = 6.55957*nombre;
     return resultat;
}
 
float euros(float nombre )
{
      float resultatF = 0;
      resultatF = nombre/6.55957;
      return resultatF;
}
 
int main(void)
{
    float nombre_entre = 0, resultat = 0;
    int reponse = 0;
    printf ("Bienvenue dans le programme de conversion hypt08\n\n\n");
    printf("1 - Convertir des euros en Francs\n\n");
    printf("2 - Convertir des Francs en euros\n\n");
    printf("Entrez votre choix: ");
    scanf("%d" , &reponse);
    printf("\n");
 
    switch ( reponse )
    {
   	 case 1:
   	      printf("Taper votre nombre a convertir: \n");
    	  scanf("%f" , &nombre_entre );
    	  resultat = Francs(nombre_entre);
          printf("Vous possedez %f Francs\n", resultat);
          break;
     case 2:
          printf("Taper votre nombre a convertir: \n");
          scanf("%f" , &nombre_entre );
          resultat = euros(nombre_entre);
          printf("Vous possedez %f Euros\n", resultat);
          break;
     default :
             printf("Mauvaise manipulation , relancez le programme....");
             break;
     }
    printf("Merci d'avoir utilise Convhypt08");
    return 0;
}