LogiQuest
Back to Control Instructions
2

What will be the output of the program?

#include <stdio.h>

int main(void) {
    int x = 3;
    switch (x) {
        case 1: printf("one ");
        case 3: printf("three ");
        case 4: printf("four ");
        default: printf("other");
    }
    printf("\n");
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.