Computers

12th

grade

Image

Control Structures

77
plays

10 questions

Show Answers
See Preview
  • 1. Multiple Choice
    30 seconds
    1 pt

    #include<stdio.h>

    int main()

    {

    int num=1; //initializing the variable

    while(num<=10) //while loop with condition

    {

    printf("%d\n",num);

    num++; //incrementing operation

    }

    return 0;

    }

    1 2 3 4 5 6 7 8 9 10

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    1

    2

    3

    4

    5

    6

    7

    8

    9

    1 2 3 4 5 6 7 8 9

  • 2. Multiple Choice
    30 seconds
    1 pt

    4) What will be the output of following program ?

    #include < stdio.h >

    int main()

    {

    int tally=0;

    for(;;)

    {

    if(tally==10)

    break;

    printf("%d ",++tally);

    }

    return 0;

    }

    0 1 2 3 4 5 6 7 8 9 10

    0 1 2 3 ... infinite times

    1 2 3 4 5 6 7 8 9 10

    1 2 3 4 5 6 7 8 9

  • 3. Multiple Choice
    30 seconds
    1 pt

    The continue statment cannot be used with

    for

    while

    do...while

    switch

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?