C MCQ Questions and Answers on Loops While For Do While 2

Image

Learn C Programming MCQ Questions and Answers on Loops like While Loop, For Loop and Do While Loop. Loops execute a series of statements until a condition is met or satisfied. Easily attend exams after reading these Multiple Choice Questions.

Go through C Theory Notes on Loops before studying questions.



1) Choose facts about continue; statement is C Language.
A) continue; is used to take the execution control to next iteration or sequence
B) continue; statement causes the statements below it to skip for execution
C) continue; is usually accompanied by IF statement.
D) All the above.
Answer [=]
Answer[=]
2) What is the output of C Program.?
int main()
{
    int a=14;
    
    while(a<20)
    {
        ++a;
        if(a>=16 && a<=18)
        {
            continue;
        }
        printf("%d ", a);
       
    }

    return 0;
}
A) 15 16 17 18 19
B) 15 18 19
C) 15 16 20
D) 15 19 20
Answer [=]
Answer[=]
3) 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.
Answer [=]
Answer[=]
4) 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.
Answer [=]
Answer[=]
5) 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
Answer [=]
Answer[=]
6) 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
Answer [=]
Answer[=]
7) What is the output of C Program.?
int main()
{
    int a=0, b=0;
    while(++a < 4)
        printf("%d ", a);

    while(b++ < 4)
        printf("%d ", b);

    return 0;
}
A) 0 1 2 3 1 2 3 4
B) 1 2 3 1 2 3 4
C) 1 2 3 4 1 2 3 4
D) 1 2 3 4 0 1 2 3
Answer [=]
Answer[=]


 

8) What is the output of C Program.?
int main()
{
    int a=10,b=20;
    
    if(a==9 AND b==20)
    {
        printf("Hurray..");
    }
    
    if(a==10 OR b==21)
    {
        printf("Theatre");
    }

    return 0;
}
A) Theatre
B) Hurray Theatre
C) No output
D) Compiler error
Answer [=]
Answer[=]
9) What are C ASCII character ranges.?
A) A to Z = 65 to 91
B) a to z = 97 to 122
C) 0 to 9 = 48 to 57
D) All the above
Answer [=]
Answer[=]
10) Expand or Abbreviate ASCII with regard to C Language.
A) Australian Standard Code for Information Interchange
B) American Standard Code for Information Interchange
C) American Symbolic Code for Information Interchange
D) Australian Symbolic Code for Information Interchange
Answer [=]
Answer[=]


Like or Share

Show some care. Like or Subscribe. [FB]...[Youtube]

C MCQ App by ExamTray 

Android APP

Java MCQ App by ExamTray 

Android APP
ALL MCQ App by ExamTray Android APP

Ad

 

Some good C Books

Book Price
1. C: The Complete Reference  Check Price
2. Let Us C Check Price
3. Programming in ANSI C Check Price
4. The C Programming Language Check Price

We may get some affiliate commission for the above purchases.