IP Addresses ending in 0 or 255 in IPV4
It is a common misconception that IP addresses ending in 255 or 0 can never be assigned to hosts on a subnet, but this is purely an artifact of classful addressing.
In classful addressing (now obsolete with the advent of CIDR), there are only 3 possible subnet masks: 255.0.0.0 (Class A), 255.255.0.0 (Class B), 255.255.255.0 (Class C). If we have the subnet 192.168.5.0/255.255.255.0, the network identifier 192.168.5.0 refers to the entire network, so to avoid confusion, it cannot be assigned to a device on the network.
A broadcast address is an IP address that allows information to be sent to all machines on a given subnet rather than a specific machine. Generally, the broadcast address is found by taking the bit complement of the subnet mask and then OR-ing it bitwise with the network identifier. More simply, the broadcast address is the last IP address in the range belonging to the subnet. In our example, the broadcast address would be 192.168.5.255, so to avoid confusion this IP address also cannot be assigned to a host. On a Class A, B, or C subnet, the broadcast address would always end in 255.
However, this does not mean that all IP addresses ending in 255 cannot be used as host IP addresses. For example, if we had a Class B subnet 192.168.0.0/255.255.0.0, this is equivalent to the range 192.168.0.0 - 192.168.255.255. The broadcast address would be 192.168.255.255. However, we can assign 192.168.1.255, 192.168.2.255, etc. (though this can cause confusion). Also, 192.168.0.0 is the network identifier and so cannot be assigned, but 192.168.1.0, 192.168.2.0, etc. can be assigned (though this can also cause confusion).
With the advent of CIDR, broadcast addresses may not necessarily end with 255.
In general, the first and last IP addresses in a subnet are used as the network identifier and broadcast address, respectively. All other IP addresses in the subnet can be assigned to hosts on the subnet.