Return type of function

int sum( )
{
return NULL;} this piece of code runs successfully but i cant understand why? ,Since the return type and value returned by function are different.

NULL is typically defined as (void *)0 and conversion of NULL to integral types is allowed
and hence it is converted to an integer and returned as zero
hope that clears your doubt.
if yes, please mark it as resolved