Loops


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *S = "";
    do
    {
    printf("Krishana");
    } while (S);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    "Krishana" infinite times


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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    "Interview Mania" infinite times



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    "Interview Mania" one time


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int k = 4;
    do
    {
    printf("Interview Mania\n");
    } while (k < 3);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    "Interview Mania" one time



  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    int k = 0;
    while (k < 3)
    {
    k++;
    printf("Hello\n");
    while (k < 5)
    {
    k++;
    printf("Interview Mania\n");
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Hello is printed 1 times, Interview Mania 4 times