--:--









Quiz for Error handling perror

Course: C Language | Subject: Unit 10 | Topic: Advanced Topics



Logo

Q1: What does the perror function do in C?

Logo

Q2: Which header file is required to use perror?

Logo

Q3: What argument does perror take?

Logo

Q4: If you call perror("Error"), what is printed?

Logo

Q5: Does perror modify the value of errno?

Logo

Q6: Which of the following is true about perror?

Logo

Q7: Which standard output stream does perror use?

Logo

Q8: Which function is commonly called before perror to detect errors?

Logo

Q9: Is perror thread-safe in modern systems?

Logo

Q10: What happens if you call perror with NULL?

Logo

Q11: Which function complements perror for getting error messages as strings?

Logo

Q12: Can perror be used to print errors from system calls?

Logo

Q13: What type of argument does perror require?

Logo

Q14: Which of the following is a valid use of perror?

Logo

Q15: What is the output of perror("Error") if errno = ENOENT?

Logo

Q16: Is it necessary to reset errno before calling perror?

Logo

Q17: Which of the following functions does NOT set errno?

Logo

Q18: Why is perror preferred over printf for error messages?

Logo

Q19: What happens if you pass an empty string "" to perror?

Are you ready to start test? Set your time limit