switch problems

claude_tech's Avatar, Join Date: Jun 2011
Newbie Member
Hi,
i want to use two 'switch' in my code but it didn't work :
Code:
#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");   }; }
help please
claude_tech's Avatar, Join Date: Jun 2011
Newbie Member
Code:
#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");
 
};
}