i have the following class B : 172.16.0.0 /16

i want someone to confirm that the solution is correct for the first 3 sub-networks :

we will take 4 bits to have 16 networks that can fit the request , so my new subnet mask is : 255.255.240 .0

now , the first three networks are (the magic number is 16 ):

First network : 172.16.0.0

first valid IP : 172.16.0.1

Last Valid IP: 172.16.15.254

Broadcast: 172.16.15.255

==========================

Second network : 172.16.16.0

first valid IP : 172.16.16.1

Last Valid IP: 172.16.31.254

Broadcast: 172.16.31.255

==========================

Third network : 172.16.32.0

first valid IP : 172.16.32.1

Last Valid IP: 172.16.47.254

Broadcast: 172.16.47.255

==========================

so is this solution is correct for the first three subnets ?!

i have another question which : What is the full subnet mask for address 172.16.5.10/28?

My answer was : 255.255.255.240

but i have this friend that told this is not correct because class B can't have such subnet mask that goes with 28 bits for network !!!!

my answer was it's ok we can take up to 30 bits for the network and at least 2 bits for the host for every class(A,B,C) of the IPs because taking more than 30 bits (example: if take 31 bit for networks would resulting for the law 2^h-2 (so we have one bit left for the hosts h=1 ) ---> 2^1-2=2-2=0 and that's not possible to have 0 hosts per network !!! )

so please correct me again if i'm wrong or there is something i'm missing in the subnetting thing

thank you all , Kind regards