When can you find out the gender of your baby?

What week did you find out and how?