C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

C Programming Multiple Choice Questions (MCQ)

C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 26



Share with a Friend

Multiple Choice Questions


C Programming - Conditional Statements & Loops Multiple Choice Questions (MCQ) - Set 26

126. What is the output of C Program with switch statement ?
int main()
{
    int a=3;
    
    switch(a)
    {
        case 2: printf("ZERO "); break;

        case default: printf("RABBIT ");
    }
    
}
A). RABBIT
B). ZERO RABBIT
C). No output
D). Compiler error
View Answer
Correct: D




127. What is the output of C Program with switch statement or block ?
int main()
{
    int a=3;
    
    switch(a)
    {

    }
    
    printf("MySwitch");
}
A). MySwitch
B). No Output
C). Compiler Error
D). None of the above
View Answer
Correct: A




128. What is the output of C Program with switch statement or block ?
int main()
{
    int a;

    switch(a)
    {
        printf("APACHE ");
    }

    printf("HEROHONDA");
}
A). APACHE HEROHONDA
B). HEROHONDA
C). No Output
D). Compiler error
View Answer
Correct: B




129. What is the output of C program with switch statement or block ?
int main()
{
    int a;

    switch(a);
    {
        printf("DEER ");
    }

    printf("LION");
}
A). LION
B). DEER LION
C). Compiler error
D). None of the above
View Answer
Correct: B




130. What is the output of C Program with switch statement or block ?
int main()
{
    static int a=5;

    switch(a)
    {
        case 0: printf("ZERO ");break;
        case 5: printf("FIVE ");break;
        case 10: printf("DEER ");
    }

    printf("LION");
}
A). ZERO FIVE DEER LION
B). FIVE DEER LION
C). FIVE LION
D). Compiler error
View Answer
Correct: C