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 24



Share with a Friend

Multiple Choice Questions


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

116. Choose a correct statement about C break; statement ?

A). break; statement can be used inside switch block
B). break; statement can be used with loops like for, while and do while.
C). break; statement causes only the same or inner loop where break; is present to quit suddenly.
D). All the above.
View Answer
Correct: D




117. The following program segment
{
        int sum, index;
        index = 50;
        while (index > = 0) 
        {
                sum =sum/index;
                -index;
        }
} 
A). Will give a run time error
B). Will give a compilation error
C). Will give a linking error
D). None of the above
View Answer
Correct: B




118. Choose a correct statement about C language break; statement.
A). A single break; statement can force execution control to come out of only one loop.
B). A single break; statement can force execution control to come out of a maximum of two nested loops.
C). A single break; statement can force execution control to come out of a maximum of three nested loops.
D). None of the above.
View Answer
Correct: A




119. Choose a correct C Statement regarding for loop.
for(; ;);
A). for loop works exactly first time
B). for loop works infinite number of times
C). Compiler error
D). None of the above
View Answer
Correct: B




120. What is the output of C Program ?
int main()
{
    int a=10, b, c;
    b=a++;
    c=++a;
    printf("%d %d %d", a, b, c);

    return 0;
}
A). 10 11 12
B). 12 10 12
C). 12 11 12
D). 12 12 12
View Answer
Correct: B