Error Handling
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
FILE *fp = stdout;
stderr = fp;
fprintf(stderr, "%s", "Interveiw Mania");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Interveiw Mania
- What happens when we use the following C statement?
fprintf(stderr, "error: could not open file");
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The diagnostic output is directly displayed in the output
- stderr is similar to?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
stdin
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
char buff[25];
stderr = stdin;
fscanf(stderr, "%s", buff);
printf("%s\n", buff);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Whatever user types
- Within main, return expr statement is equivalent to ________
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
exit(expr)