Check out example codes for "c++ switch case statement". It will help you in understanding the concepts better.

Code Example 1

switch (n)
{
    case 1: // code to be executed if n = 1;
        break;
    case 2: // code to be executed if n = 2;
        break;
    default: // code to be executed if n doesn't match any cases
}

Learn ReactJs, React Native from akashmittal.com