For Loop

Post-Test

  1. What will be the output of the following C code?

  2. #include <stdio.h>
    int main()
    {
    while ()
    printf("In while loop ");
    printf("After loop\n");
    }

    In while loop after loop
    After loop
    Compile time error
    Infinite loop

  3. How many times i value is checked in the following C code?

  4. #include <stdio.h>
    int main()
    {
    int i = 0;
    while (i < 3)
    i++;
    printf("In while loop\n");
    }

    2
    3
    4
    1

  5. What is the output of C Program?

  6. #include
    int main()
    {
    int a = 3;
    while(a = 5)
    {
    printf("Hello ");
    break;
    }
    printf("Know Program ");
    return 0;
    }

    Hello
    Know Program
    Hello Know Program
    Compiler-time error

  7. Which keyword can be used for coming out of recursion?

  8. return
    break
    exit
    both A and B

  9. Choose a right C Statement.

  10. Loops or Repetition block executes a group of statements repeatedly.
    Loop is usually executed as long as a condition is met
    Loops usually take advantage of Loop Counter
    All of the above