Planning gender of a child is only decided by god however god has given resources and knowledge to Mankind which is useful for planning a gender of a child. Scientific studies shows that formation of gender of a child depends upon sperm and eggs. There are two type of Chromosome in Sperm i.e XX and XY which decide the gender of a child.
Scientifically it has been proven that when XX chromosome meet with XY it will give a birth to a male child and when XX meets XX it will give birth to a girl child.

