Programming for Problem Solving (3110003) MCQs

MCQs of Control structure in C

Showing 31 to 40 out of 41 Questions
31.
The continue statement cannot be used with
(a) for
(b) while
(c) do while
(d) switch
Answer:

Option (d)

32.
Which loop is guaranteed to execute at least one time?
(a) for
(b) while
(c) do while
(d) None of these
Answer:

Option (c)

33.
do-while loop terminates when conditional expression returns?
(a) One
(b) Zero
(c) Non - zero
(d) None of these
Answer:

Option (b)

34.
if the condition is missing in a for loop?
(a) it is assumed to be present and taken to be false
(b) it is assumed to be present and taken to the true
(c) it results in a syntax error
(d) execution will be terminated
Answer:

Option (b)

35.
Loops in C Language are implemented using?
(a) while Block
(b) for Block
(c) do while Block
(d) All of these
Answer:

Option (d)

36.
What is the output?

void main()
{
    while(true)    
    {
        printf("Hello");
        break;
    }
}

(a) Hello
(b) Hello is printed infinite times
(c) Blank
(d) Error
Answer:

Option (d)

37.
What is the output?

void main()
{
    int a=5;    
    while(a==5)    
    {
        printf("Hello");
        break;
    }
}

(a) Hello
(b) Hello is printed infinite times
(c) Blank
(d) Error
Answer:

Option (a)

38.
What is the output?

void main()
{
    int a=5;
    while(a=10)    
    {
        printf("Hello\n");
        break;
    }
    printf("India");
}

(a) India
(b) Hello
India
(c) Hello is printed infinite times
(d) Error
Answer:

Option (b)

39.
What is the output?

void main()
{
    int a=5;
    while(a >= 3);
    {
        printf("Hello ");
    }
}

(a) Hello
(b) Hello is printed infinite times
(c) Blank
(d) Error
Answer:

Option (c)

40.
What is the output?

void main()
{
    int a=25;
    while(a <= 27)
    {
        printf("%d ", a);
        a++;
    }
}

(a) 25 25 25
(b) 25 26 27
(c) 27 27 27
(d) Error
Answer:

Option (b)

Showing 31 to 40 out of 41 Questions