Auto-initialization of variables
Note that awk automatically initializes variables for you, so sum = 0 is not strictly necessary (but preferable for clarity):
As a side note, awk doesn’t actually need a file to work on if you only provide it with a BEGIN statement and no body:
(that’s one easy way to do floating-point math on the command line, as Bash itself only supports integers).