Loops


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 0, L = 0;
    Level1: while (k < 3)
    {
    k++;
    while (L < 15)
    {
    printf("Hey...\n");
    goto Level1;
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Hey...
    Hey...
    Hey...


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int k = 0, L = 0;
    Level1: while (k < 4)
    {
    k++;
    while (L < 15)
    {
    printf("Hello...\n");
    goto Level1;
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Hello...
    Hello...
    Hello...
    Hello...



  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int k = 2;
    if (k == 2)
    {
    goto Lavel;
    }
    Lavel: printf("Interview Mania");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Interview Mania


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int n = 0, L;
    if (n == 0)
    goto Label;
    for (L = 0; L < 3; L++)
    {
    printf("Hey");
    Label: L = printf("%03d", n);
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    000



  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int n = 5, L;
    Label: printf("%d", n);
    if (n == 5)
    goto Label;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    5 Infinite times