Home » C Programming » Loops » Question
  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. Hello is printed 1 times, Interview Mania 1 times
    2. Hello is printed 4 times, Interview Mania 4 times
    3. Hello is printed 1 times, Interview Mania 4 times
    4. All of above
    5. None of these
Correct Option: C

Hello is printed 1 times, Interview Mania 4 times



Your comments will be displayed only after manual approval.