Simply we can thought as
your program always run under operating system like windows. simply
int main()
function is a integer return type. if the return is 0 it's send a message to
os is that the program is OK no error is generated while running the program and exit is success.
if you use
void main()
you don't have to return anything because it is void return type.OS automatically manage it.but you unable to track that the program run correctly or not.(i am not sure about it , i told it from my experience and learning )