Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Which of the following statement is correct about the program? #include<stdio.h> int main() { FILE fp; char ch; int i=1; fp = fopen("myfile.c", "r"); while((ch=getc(fp))!=EOF) { if(ch == '\n') i++; } fclose(fp); return 0; } ?->(Show Answer!)
1. Which of the following statement is correct about the program? #include<stdio.h> int main() { FILE fp; char ch; int i=1; fp = fopen("myfile.c", "r"); while((ch=getc(fp))!=EOF) { if(ch == '\n') i++; } fclose(fp); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
This program counts the number of lines in the file myfile.c by counting the character '\n' in that file.