Question: Why does the function "main()" appears in every C code? Is it an optional code? What is its use?

Answer: This is how you tell the C compiler where to start execution. This is not optional for a complete program. That is, the program always starts running by calling the main() function, which may call other functions in turn.  We say that main() is an "entry point" for your code, a place to start execution.
This question from the Yahoo Q&A forum is categorized in the topic: Computers & Internet