Pericles realizes in the answer to the riddle that the king is having sex with his daughter. That is the answer to the riddle. The King is not merley angry that Pericles answered the riddle he is horrified that he has answered it because it means making the answer public. This is why the king prevents him from answering the riddle and saves face by giving him 40 days to come up with the answer.