-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.c
61 lines (51 loc) · 1.3 KB
/
menu.c
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
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdio.h>
int main(int argc, const char * argv[])
{
int choixMenu = 0;
printf("===Menu===\n");
printf("1. Royal cheese\n");
printf("2. Mc Deluxe\n");
printf("3. Mc Bacon\n");
printf("4. Big Mac\n");
while (choixMenu < 1 || choixMenu > 4) //doesn't work if the user input a letter, have to fix it
{
printf("Votre choix ? 1, 2, 3 ou 4 ?\n");
scanf("%d", &choixMenu);
switch (choixMenu)
{
case 1:
printf("vous avez choisis le Royal cheese !\n");
break;
case 2:
printf("vous avez choisis le Mc deluxe !\n");
break;
case 3:
printf("vous avez choisis le Mc Bacon !\n");
break;
case 4:
printf("vous avez choisis le Big Mac !\n");
break;
default:
printf("vous n'avez pas faim ?\n");
}
}
int choixDessert = 0;
printf("\nvoulez-vous un dessert ?\n oui : 1\n non : 0\n");
scanf("%d", &choixDessert);
switch (choixDessert)
{
case 1:
printf("\n");
break;
default:
printf("\n");
break;
}
if(choixDessert == 1){
printf("\nca fera 15€\n");
}
else {
printf("\nca fera 10€\n");
}
return 0;
}