/* Same output as the above program, but use switch instead. */ #include main() { int year; for (year = 1992; year <= 2012; year = year + 1) { printf("%d: ", year); switch (year % 4) { /* Always write the curly braces. */ case 0: printf("presidential election year\n"); break; case 2: printf("congressional election year\n"); break; default: printf("local election year\n"); break; } } }