The rapist is hanged in front of public so that public become more aware of the consequence of this heinous crime.
China is really strict about rapist. Rape is a brutal crime and a death penalty is declared once the rapist is convicted. This is done by firing a single bullet at the spinal cord joining the neck. Another punishment given to the rapists in China is castration. The same punishment is given for other heinous crimes too. It is worth noting that the court proceedings are very quick.
6. NORTH KOREA:
In North Korea, a rapist is punished by firing the culprit by firing squad. Their lines of justice are so blurred that for all we know, they just use this as a cover up to execute dissidents.