Which of the given statement is true with respect to the function atexit()?

Category: QuestionsWhich of the given statement is true with respect to the function atexit()?
Editor">Editor Staff asked 11 months ago

Which of the given statement is true with respect to the function atexit()?
 
(a) The atexit() function cannot return to its caller
 
(b) The atexit() function  is used to return zero if the registration succeeds, nonzero if it fails
 
(c) The atexit() function returns no value
 
(d) The atexit() function causes abnormal program termination to occur
 
The question was asked during an interview for a job.
 
My question is based upon General Utilities in division C Library of C
NCERT Solutions for Subject Computer science (C Programming) Select the correct answer from above options 
Interview Questions and Answers, Database Interview Questions and Answers for Freshers and Experience

1 Answers
Editor">Editor Staff answered 11 months ago

The correct answer is (b) The atexit() function  is used to return zero if the registration succeeds, nonzero if it fails
 
Easiest explanation – The prototype of function is  int atexit (void (*func) (void) );
 
The atexit() function is used to register the function pointed to by func, to be called without arguments at normal program termination.