# Cisco CCNA mock exam questions sample test – Question 140

.How many IP addresses can be assigned to hosts in subnet 192.168.12.64/26?

A. 32
B. 62
C. 128
D. 256

Explanation:
Subnet 192.168.12.64/26 has 62 IP addresses that can be assigned to hosts.
The formula to calculate the available number of hosts is:
2n – 2 = x
Where n = the number of host bits in the subnet mask and x = the number of possible hosts.
You will subtract 2 from the hosts calculation to remove the first address (the network ID) and the last address (the broadcast ID) from the valid hosts range. These addresses are
reserved as the network ID and the broadcast address, respectively, in each subnet.
An IP address has 32 available bits divided into four octets. In this scenario, the /26 indicates that the subnet mask is 26 bits long, or that 26 bits are reserved for the network portion of
the address. This leaves 6 bits for the host addresses (32 – 26 = 6). The number of host addresses would be calculated as follows:
Number of hosts = 26 – 2
Number of hosts = 64 – 2 = 62
Another simple way of determining the number of hosts in a range, when the subnet mask extends into the last octet, is to determine the decimal value of the last bit in the subnet
mask after converting it to binary notation. This process only works when the subnet extends into the last octet, meaning that the subnet is greater than /24. The /26 subnet mask
equals 26 network bits and 6 hosts bits, written as follows:
11111111.11111111.1111111.11000000
The 1s represent network bits and the 0s represent host bits.
In this example, the 26th bit (read from left to right) has a decimal value of 64, indicating that this subnet has 64 addresses. Subtract 2 to represent the network and broadcast
addresses (64 – 2 = 62). This shows that this subnet range can be used to address 62 hosts.