There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

So you have:

256 addresses - 252 addresses = 4 addresses (and not subnets).

So, since the original statement was in error, I'm left not understanding what to evaluate or comment on.

You ask us to explain so I'll try in hope that something will stick to the wall here: :-)

A subnet mask of:

11111111 11111111 11111111 111111111 is 255.255.255.255

subtract 3 to get:

11111111 11111111 11111111 111111100 is 255.255.255.252

Now subtract the next 2 least significant "1" bits (which is 12)

11111111 11111111 11111111 111110000 is 255.255.255.240

The locations where the subnet mask is "1" represent the network address.

The locations were the subnet mask is "0" represent the host addresses plus network address value of "0" plus the broadcast address of all "1"s.

Examples:

192.168.0.0 / 255.255.255.252 is:

11000000 10101000 00000000 00000000

11111111 11111111 11111111 11111100

So, with the subnet mask, the host address is 00 - the network address

192.168.0.1 / 255.255.255.252 is:

11000000 10101000 00000000 00000001

11111111 11111111 11111111 11111100

So, with the subnet mask, the host address is 01

192.168.0.2 / 255.255.255.252 is:

11000000 10101000 00000000 00000010

11111111 11111111 11111111 11111100

So, with the subnet mask, the host address is 10 or 2 decimal

192.168.0.3 / 255.255.255.252 is:

11000000 10101000 00000000 00000011

11111111 11111111 11111111 11111100

So, with the subnet mask, the host address is 11 or 3 decimal .. the broadcast address.

Above, I picked a subnet with 4 addresses, 4-2= 2 usable.

Now, increase the subnet mask by two more zeros:

192.168.0.0 / 255.255.255.252 is:

11000000 10101000 00000000 00000000

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 00 - the network address

192.168.0.1 / 255.255.255.240 is:

11000000 10101000 00000000 00000001

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 01 binary or decimal.

192.168.0.2 / 255.255.255.252 is:

11000000 10101000 00000000 00000010

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 10 or 2 decimal

192.168.0.3 / 255.255.255.252 is:

11000000 10101000 00000000 00000011

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 11 or 3 decimal

...........

192.168.0.4 / 255.255.255.252 is:

11000000 10101000 00000000 00000100

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 100 or 4 decimal

..........

192.168.0.8 / 255.255.255.252 is:

11000000 10101000 00000000 00001000

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 1000 or 8 decimal

..........

192.168.0.8 / 255.255.255.252 is:

11000000 10101000 00000000 00001111

11111111 11111111 11111111 11110000

So, with the subnet mask, the host address is 1111 or 815 decimal - the broadcast address.

So, the number of zeros on the right end of the subnet mask tells you how many bits can represent addresses.

AND, if you take a particular pattern like the above AND call that a subnet then there is one (1) subnet.

BUT, if you start with a pattern like the above AND break it into smaller subnets then there are a variety of combinations to choose from.

Further, if you set some ground rules, then you might use that context to talk about subnets.

Here is an example:

Above we have an address space of 4 bits.

We know that 2 bits is the smallest meaningful subnet size yielding 4 addresses and 2 usable addresses.

Since we have 4 bits in the subnet mask, we can split that up into the smallest possible subnets of:

192.168.1.0 / 255.255.255.252

and

192.168.1.4 / 255.255.255.252

and

192.168.1.8 / 255.255.255.252

and

192.168.1.12 / 255.255.255.252

So, in this case, 4 bits yields 4 (of the smallest useful) subnets.

If there are 5 bits then there will be 32 addresses and 32/4=8 (of the smallest useful) subnets.

and so forth....

But I'm not sure that figuring out how many of the smallest possible subnets is very useful.

You can always say this:

2^N (where N is the number of zero bits in the subnet mask) is the total number of addresses available in that subnet.

2^(N-1) is the number of addresses in the 2 largest possible subnets within,

2^(N-2) is the number of of addresses in the 4 largest possible subnets within.

2^(N-n) (where N-2=n is the number of addresses in the smallest possible subnets within.

So, with all that, are we getting closer to what you're looking for?