C- Library Functions MCQ Questions and Answers

Practice Mode
Showing 10 of 29 questions
Q1
What will the function rewind() do?
  • A Reposition the file pointer to a character reverse.
  • B Reposition the file pointer stream to end of file.
  • C Reposition the file pointer to begining of that line.
  • D Reposition the file pointer to begining of file.
Answer: Option D
Q2
Input/output function prototypes and macros are defined in which header file?
  • A conio.h
  • B stdlib.h
  • C stdio.h
  • D dos.h
Answer: Option C
Q3
Which standard library function will you use to find the last occurance of a character in a string in C?
  • A strnchar()
  • B strchar()
  • C strrchar()
  • D strrchr()
Answer: Option D
Q4
What is stderr ?
  • A standard error
  • B standard error types
  • C standard error streams
  • D standard error definitions
Answer: Option C
Q5
Does there any function exist to convert the int or float to a string?
  • A Yes
  • B No
Answer: Option A
Q6
What is the purpose of fflush() function.
  • A flushes all streams and specified streams.
  • B flushes only specified stream.
  • C flushes input/output buffer.
  • D flushes file buffer.
Answer: Option A
Q7
Can you use the fprintf() to display the output on the screen?
  • A Yes
  • B No
Answer: Option A
Q8
What will the function randomize() do in Turbo C under DOS?
  • A returns a random number.
  • B returns a random number generator in the specified range.
  • C returns a random number generator with a random value based on time.
  • D return a random number with a given seed value.
Answer: Option C
Q9
Which header file should be included to use functions like malloc() and calloc()?
  • A memory.h
  • B stdlib.h
  • C string.h
  • D dos.h
Answer: Option B
Q10
Which library function is used to read a string from standard input in C?
  • A scanf()
  • B gets()
  • C read()
  • D input()
Answer: Option B
Explanation: gets() function is used to read a string from standard input.
Questions and Answers for Competitive Exams Various Entrance Test