What will be the output of the following C code? [code] #include <stdio.h> #include <string.h> int main() { char

Lan Anh

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    #include <string.h>
    int main()
    {
        char line[3];
        fgets(line, 3, stdin);
        printf("%d\n", strlen(line));
        return 0;
    }
A. 3
B. 1
C. Any length since line did not end with null character
D. Depends on the standard
 

Tìm kiếm

Back
Top