------------------------------------------------------------------------------
MC logo
Switch
[^] Code Examples
------------------------------------------------------------------------------
<<Tom Five Times V switch1.c Switch Using Break>>
#include <stdio.h>

/* Switch demo. */

int main()
{
        int m;

        scanf("%d", &m);

        switch(m)
        {
        case 1: printf("1\n");
        case 2: printf("2\n");
        case 3: printf("3\n");
        default: printf("Otherwise\n");
        }
}
Reading: Ch. 8
<<Tom Five Times V Switch Using Break>>