Network address and subnet mask calculator in C