1.

Which of the following statement is correct about the program?_x000D_ #include_x000D_ _x000D_ int main()_x000D_ {_x000D_ FILE *fp;_x000D_ char str[11], ch;_x000D_ int i=0;_x000D_ fp = fopen("INPUT.TXT", "r");_x000D_ while((ch=getc(fp))!=EOF)_x000D_ {_x000D_ if(ch == '\n' || ch == ' ')_x000D_ {_x000D_ str[i]='\0';_x000D_ strrev(str);_x000D_ printf("%s", str);_x000D_ i=0;_x000D_ }_x000D_ else_x000D_ str[i++]=ch;_x000D_ }_x000D_ fclose(fp);_x000D_ return 0;_x000D_ }

A. The code writes a text to a file
B. The code reads a text files and display its content in reverse order
C. The code writes a text to a file in reverse order
D. None of above
Answer» C. The code writes a text to a file in reverse order


Discussion

No Comment Found

Related MCQs