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 18



Share with a Friend

Multiple Choice Questions


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

86. What is the output of C Program ?
int main()
{
    int a=5;
    
    while(a==5)    
    {
        printf("RABBIT");
        break;
    }

    return 0;
}
A). RABBIT is printed unlimited number of times
B). RABBIT
C). Compiler error
D). None of the above.
View Answer
Correct: B




87. What is the output?
void main()
 {
    int k = 0;
    for (k)
      printf("Hello");
 }
A). Error
B). Hello
C). Blank
D). Infinite loop
View Answer
Correct: A




88. What is the output of C Program ?
int main()
{
    int a=5;
    
    while(a=123)    
    {
        printf("RABBIT\n");
        break;
    }
    printf("GREEN");
    
    return 0;
}
A). GREEN
B). RABBIT GREEN
C). RABBIT is printed unlimited number of times.
D). Compiler error.
View Answer
Correct: B




89. In the given loop construct, which one is executed only once always? for(exp1; exp2; exp3)
A). exp1
B). exp3
C). exp1 and exp3
D). exp1, exp2 and exp3
View Answer
Correct: A




90. What is the output of C Program ?
int main()
{
    int a=5;
    
    while(a >= 3);
    {
        printf("RABBIT\n");
        break;
    }
    printf("GREEN");
    
    return 0;
}
A). GREEN
B). RABBIT GREEN
C). RABBIT is printed infinite times
D). None of the above
View Answer
Correct: D