IBPS IT OFFICER MCQ – 72

IT OFFICER

1. Which type of files can’t be opened using fopen()?
a) .txt
b) .bin
c) .c
d) None of the mentioned

Click here to View Answer
Answer d) None of the mentioned

2. Which of the following causes an error?
a) Trying to read a file that doesn’t exist
b) Inability to write data in a file
c) Failure to allocate memory with the help of malloc
d) All of the mentioned

Click here to View Answer
Answer d) All of the mentioned

3. What is the purpose of the function? int ferror(FILE *fp)?
a) They check for input errors
b) They check for output errors
c) They check for all types of errors
d) They check for error in accessing the file

Click here to View Answer
Answer b) They check for output errors

4. Stderr is similar to?
a) stdin
b) stdout
c) Both stdout and stdin
d) None of the mentioned

Click here to View Answer
Answer b) stdout

5. Which of the following function can be used to terminate the main function from another function safely?
a) return(expr);
b) exit(expr);
c) abort();
d) Both b and c

Click here to View Answer
Answer b) exit(expr);

6. What happens when we use fprintf(stderr, “error: could not open filen”);?
a) The diagnostic output is directly displayed in the output
b) The diagnostic output is pipelined to the output file
c) The line which caused error is compiled again
d) The program is immediately aborted

Click here to View Answer
Answer a) The diagnostic output is directly displayed in the output

7. fputs function writes a string to a file that only ends with a newline?
a) True
b) False

Click here to View Answer
Answer b) False

8. gets function checks overflow run?
a) True
b) False

Click here to View Answer
Answer b) False

9. puts function adds new-line character?
a) True
b) False

Click here to View Answer
Answer a) True

10. The simplest form of a cluster is ______ approach?
a) Beowolf
b) Sequioa
c) Stone
d) None of the above

Click here to View Answer
Answer a) Beowolf

Check out our latest videos on youtube