Input & Output
- what is the return value of fputs()?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Non-negative if no error & EOF if an error occurs
- Which of the following is the right declaration for fgets() inside the library?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
char *fgets(char *line, int maxline, FILE *fp);
- Which function has a return type as char pointer?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
fgets
- Identify N library function for line input and output in the following C code?
#include <stdio.h>
int N(char *str, FILE *iop);
{
int ch;
while (ch = *str++)
putc(ch, iop);
return ferror(iop) ? EOF : 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
Compilation Error
- What will be the output of the following C function when EOF returns?
int fputs(char *line, FILE *fp)
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
When an error occurs