/* an example of what happens when we don't use the break statement in each of the cases. Run the program, and try entering value 10 for the amount compare the results to those of switch1.c */ #include int main() { int amount; int result = 10; printf("please enter amount\n"); scanf("%d", &amount); printf("current values: amount = %d, result = %d\n", amount, result); switch(amount) { case 10: printf("case 10\n"); result = amount; case 20: printf("case 20\n"); result = amount * amount; case 30: printf("case 30\n"); result = 1000 + amount; default: printf("default case\n"); result = 0; } printf("result = %d\n", result); }