NaCl has a face centered cubic close packing in which lattice points are occupied by Cl- ions whereas Na+ ions occupy all octahedral holes.Here Na+ & Cl- both have a coordination number of 6.
Effective number of A- or Cl- = (8*1/8)+(6*1/2) = 4
Effective no. of A- after removing atoms along one axes
= (8*1/8)+(4*1/2) = 3
Effective no. of B+ or Na+ = (12*1/4) + 1 = 4
Therefore the formula is A3B4