/* this program behaves the same way as the if3.c program. Try entering value 10, and compare the result to the result of the switch2.c program. */ #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; break; case 20: printf("case 20\n"); result = amount * amount; break; case 30: printf("case 30\n"); result = 1000 + amount; break; default: printf("default case\n"); result = 0; break; } printf("result = %d\n", result); }