C/c언어 수업

p245 switch

sj0020 2020. 8. 5. 12:19
#include <stdio.h>

int main(void)
{
	int num;
	printf("enter int num btwn 1 to 3: ");
	scanf("%d",&num);

	switch (num)
	{
	case 1:
		printf("A1 ");
		printf("A2 ");
	case 2:
		printf("B1 ");
		printf("B1 ");
	case 3:
		printf("C1 ");
		printf("C1 ");
	default:
		printf("Default \n");
	}
	return 0;

}