Home » C Programming » Input & Output » Question
  1. What will be the output of the following C code if 2 character is typed by the user?
    #include <stdio.h>
    #include <string.h>
    int main()
    {
    char line[25];
    fgets(line, 25, stdin);
    printf("%d\n", line[2]);
    return 0;
    }
    1. Undefined behaviour
    2. 25(ascii value of newline character)
    3. Compilation Error
    4. 64
    5. None of these
Correct Option: D

64



Your comments will be displayed only after manual approval.