Bonjour,

je veux réaliser un programme qui utilise deux 'switch'
mais ça marche pas :

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
#include <stdio.h>
 
char choix1,choix2;
 
main()
{
 
printf("ENTER UR CHOICE :\n");
choix1 = getchar();
 
switch (choix1)
 
{
 
case'y':
printf("ENTER THE FILE :\n");
choix2=getchar();
 
switch (choix2)
{
    case'1':
    printf("'.bas' file");
    break;
 
    case'2':
    printf("'.900' file");
    break;
 
    default :
	printf("WRONG CHOICE");
 
 
};
 
break;
 
case'n':
printf("2");
break;
 
    default :
	printf("WRONG CHOICE");
 
};
}
merci pour votre aide