Respuesta :

Logically and the IP address with the netmask, and you have the network number:

networkNumber = IPaddress & netmask;