title: How does int main() and void main() work?
body: <p>I am a beginner in the C language. Can anyone explain in detail using example how main(), int main(), void main(), main(void), void main(void), int main(void) work in C language?</p>
  <p>As in, what is happening when we use void main() and what is happening when I use int main() in simple language and so on?</p>
  <p>I know, but I can’t understand what is it doing:</p>
  <ol>
  <li>main() - function has no arguments</li>
  <li>int main() - function returns int value</li>
  <li>void main() - function returns nothing, etc.</li>
  </ol>
  <p>When I write a simple <em><a href="https://en.wikipedia.org/wiki/%22Hello,_World!%22_program" rel="nofollow noreferrer">Hello, World!</a></em> program using the int main() return 0, it still gives me the same output as when using void main()), so how does it work? What is its application?</p>