Is it illegal if an 24 year old gets a 17 year old pregnant?

If she is below age of consent, yes.