khuang8493
6/11/2018 - 11:31 PM

Switch Conditions

Check answer, don’t forget to add “break” for each choice, unless it’s desired to fall through.

switch (c)
{
	case 'Y':
	case 'y':
		printf("yes\n");
		break;
	case 'N':
	case 'n':
		printf("no\n");
		break;
	default:
		printf(“Sorry\n”);
}