Anyone please tell me where the main() function of the \'C\' language returns its value?
From the C99 Standard:
5.1.2.2.3 Program termination
1 If the return type of the
mainfunction is a type compatible withint, a return from the initial call to themainfunction is equivalent to calling theexitfunction with the value returned by themainfunction as its argument;
and then
7.20.4.3 The
exitfunction5 Finally, control is returned to the host environment. If the value of status is zero or
EXIT_SUCCESS, an implementation-defined form of the status successful termination is returned. If the value of status isEXIT_FAILURE, an implementation-defined form of the status unsuccessful termination is returned. Otherwise the status returned is implementation-defined.
In short, the return value of main is returned to the host environment in an implementation-defined form.