In angiosperms the zygote is diploid (2n) it is formed by the fusion of haploid (n) egg and a haploid male gamete. This diploid zygote gives rise to diploid embryo.

The primary endosperm nucleus is triploid (3n) because it is formed by the fusion of diploid (2n) secondary nucleus and a haploid (n) male gamete.
Male gamete + Secondary nucleus - Primary endosperm nucleus → endospe
(n) (2n) (3n) (3n)