Switch selection is not automatic case isolation

The modes are: 1 doubles value, 2 triples value, and 3 returns zero. Any other mode is invalid. The starter accidentally overwrites its answer. Trace its fixed inputs and explain the exact value it prints; then repair it using switch and explicit control transfers.

    Your corrected complete program must read mode and value, where value is 0..100. Print result=R for a valid mode, otherwise invalid. Failed input or an out-of-range value is invalid too. Explain why reaching default by fallthrough is possible even though a matching case was found.

Assume every integer token supplied is representable in int.

#include <stdio.h>
int main(void)
{
    int mode = 1;
    int value = 4;
    int result = 0;
    switch (mode) {
        case 1: result = value * 2;
        case 2: result = value * 3;
        case 3: result = 0;
        default: result = -1;
    }
    printf("result=%d\n", result);
    return 0;
}

