Home » C Programming » Loops » Question
  1. Which of then following is the correct output for the program given below?
    #include <stdio.h>
    int main()
    {
    int k = 5;
    while ( k++ != 5)
    printf ("%d", ++k);
    printf ("\n");
    return 0;
    }
    1. 5 6 7 ........ 127 0 1 2 3 4
    2. 5 6 7.........65535 0 1 2 3 4
    3. 5 6 ...........32767 -32766 -32765 ...... 3 4
    4. No output
Correct Option: D

Condition in while loop is false.



Your comments will be displayed only after manual approval.