Sail E0 Webinar

MCQs

Total Questions : 97 | Page 10 of 10 pages
Question 91. What is output of code given below?

    int main()

    {

        int i = 0, j = 0;

       while (i < 2)

        {

            l1 : i++;

            while (j < 3)

            {

                printf("Loop\n");

                goto l1;

            }

        }

    }

  1.    Loop Loop
  2.    Compilation error
  3.    Loop  Loop  Loop  Loop
  4.    Infinite Loop
 Discuss Question
Answer: Option D. -> Infinite Loop


none


Question 92. What is the output of code given below?

    int main()

    {

        int i = 0, j = 0;

        while (l1: i < 2)

        {

            i++;

            while (j < 3)

            {

                printf("loop\n");

                goto l1;

            }

        }

    }

  1.    loop  loop
  2.    Compilation error
  3.    loop  loop  loop  loop
  4.    Infinite loop
 Discuss Question
Answer: Option B. -> Compilation error


none


Question 93. What is the output of the code given below?

    int main()

    {

        int i = 0, j = 0;

        l1: while (i < 2)

        {

            i++;

            while (j < 3)

            {

                printf("loop\n");

                goto l1;

            }

        }

    }

  1.    loop  loop
  2.    compilation error
  3.    loop  loop  loop  loop
  4.    infinite loop
 Discuss Question
Answer: Option A. -> loop  loop


none


Question 94. The output of the code below is?

    void main()

    {

        int i = 0;

        if (i == 0)

        {

            goto label;

        }

        label: printf("Hello");

    }

  1.    Nothing
  2.    Error
  3.    Infinite Hello
  4.    Hello
 Discuss Question
Answer: Option D. -> Hello


none


Question 95. The output of the code below is?

    void main()

    {

        int i = 0, k;

        if (i == 0)

            goto label;

            for (k = 0;k < 3; k++)

            {

                printf("hi\n");

                label: k = printf("%03d", i);

            }

    }

  1.    0
  2.    hi hi hi 0 0 0
  3.    0 hi hi hi 0 0 0
  4.    0 0 0
 Discuss Question
Answer: Option A. -> 0


none


Question 96. The output of the code below is?

    void main()

    {

        int i = 0, k;

        label: printf("%d", i);

       if (i == 0)

            goto label;

    }

  1.    0
  2.    Infinite 0
  3.    Nothing
  4.    Error
 Discuss Question
Answer: Option B. -> Infinite 0


none


Question 97. What is the output of this C code?

    void main()

    {

        int i = 5, k;

        if (i == 0)

            goto label;

           label: printf("%d", i);

            printf("Hey");

    }

  1.    5
  2.    Hey
  3.    5 Hey
  4.    Nothing
 Discuss Question
Answer: Option C. -> 5 Hey


none


Latest Videos

Latest Test Papers