Home / Questions / If you want to execute C program even after main function is terminated, which function can be used?
Explanatory Question

If you want to execute C program even after main function is terminated, which function can be used?

👁 924 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  • atexit() function can be used if we want to execute any function after program is terminated normally.
  • Syntax: int atexit (void (*func)(void));
  • The function “func” will be called automatically without any arguments once program is terminated normally.