The switch Statement
C has a multiway selection branch called the switch statement which lets you choose among one of many possible branches
#include <stdio.h>
int main(void) {
int i;
i = 3;
switch ( i ) {
case 1:
….
Default:
}
Previous slide
Next slide
Back to first slide
View graphic version