Class 6 Exam  >  Class 6 Tests  >  Test: C Loops - 2 - Class 6 MCQ

Test: C Loops - 2 - Class 6 MCQ


Test Description

15 Questions MCQ Test - Test: C Loops - 2

Test: C Loops - 2 for Class 6 2024 is part of Class 6 preparation. The Test: C Loops - 2 questions and answers have been prepared according to the Class 6 exam syllabus.The Test: C Loops - 2 MCQs are made for Class 6 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: C Loops - 2 below.
Solutions of Test: C Loops - 2 questions in English are available as part of our course for Class 6 & Test: C Loops - 2 solutions in Hindi for Class 6 course. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free. Attempt Test: C Loops - 2 | 15 questions in 15 minutes | Mock test for Class 6 preparation | Free important questions MCQ to study for Class 6 Exam | Download free PDF with solutions
Test: C Loops - 2 - Question 1

Loops in C Language are implemented using?

Test: C Loops - 2 - Question 2

Choose correct C while loop syntax.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: C Loops - 2 - Question 3

Choose a correct C do while syntax.

Detailed Solution for Test: C Loops - 2 - Question 3

Semicolon after while(condition) is a must.

Test: C Loops - 2 - Question 4

What is the output of C Program?

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

    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 4

If there is no BREAK statement, while loop runs continuously util the computer hangs. BREAK causes the loop to break once and the statement below the while if any will be executed.

Test: C Loops - 2 - Question 5

What is the output of C Program?
int main()
{
    int a=5;
    
    while(a >= 3);
    {
        printf("RABBIT\n");
        break;
    }
    printf("GREEN");
    
    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 5

Notice a semicon(;) after while condition. It makes the printf and break statement blocks isolate.

while(a >= 3)
{
    ;//infinite loop
}
{
    printf("RABBIT\n");
    break;
}

Test: C Loops - 2 - Question 6

What is the output of C Program.?
int main()
{
    int a=32;
    
    do
    {
        printf("%d ", a);
        a++;
    }while(a <= 30);

    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 6

do { } block is executed even before checking while(condition) at least once. This prints 32. To loop for the second time, while (32 <= 30) fails. So, loop is quit.

Test: C Loops - 2 - Question 7

Choose a correct C Statement.

Test: C Loops - 2 - Question 8

What is the output of C Program.?
int main()
{
    int k, j;
    
    for(k=1, j=10; k <= 5; k++)
    {
        printf("%d ", (k+j));
    }

    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 8

You can initialize any number of variables inside for loop.

Test: C Loops - 2 - Question 9

What is the output of C Program.?
int main()
{
    int k;
    
    for(;;)
    {
        printf("TESTING\n");
        break;
    }

    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 9

for(;;) loop need not contain any initialization, condition and incre/decrement sections. All are optional. BREAK breaks the FOR Loop.

Test: C Loops - 2 - Question 10

What is the way to suddenly come out of or Quit any Loop in C Language?

Detailed Solution for Test: C Loops - 2 - Question 10

eg.
while(condition)
{
break;
}

Test: C Loops - 2 - Question 11

Choose a right C Statement.

Test: C Loops - 2 - Question 12

Which loop is faster in C Language, for, while or Do While.?

Test: C Loops - 2 - Question 13

Choose a correct C for loop syntax.

Detailed Solution for Test: C Loops - 2 - Question 13

Increment or decrement operation at third place.

Test: C Loops - 2 - Question 14

What is the output of C Program.?
int main()
{
    while(true)    
    {
        printf("RABBIT");
        break;
    }
    
    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 14

While(TRUE) or while(true) does not work. true is not a keyword.

Test: C Loops - 2 - Question 15

What is the output of C Program.?
int main()
{
    int a=5;
    
    while(a=123)    
    {
        printf("RABBIT\n");
        break;
    }
    printf("GREEN");
    
    return 0;
}

Detailed Solution for Test: C Loops - 2 - Question 15

while(a=123)  = while(123) = while(Non Zero Number). So while is executed. BREAK breaks the loop immediately. Without break statement, while loop runs infinite number of times.

Information about Test: C Loops - 2 Page
In this test you can find the Exam questions for Test: C Loops - 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: C Loops - 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Class 6

Download as PDF

Top Courses for Class 6