Is there any possibility to execute code even after the program exits the main() method?
In C and C++, functions registered through atexit() can be called after main() returns.
main()
In C++, static destructors can also be called after main() returns.