pregnant

Hi all! I had a question i never even thought about till now, can you find out your pregnant right when it happens? let’s say you had sex one night and that night you happen to get pregnant, would a test show it the next day?