Source: https://bundy.laverdad.edu.ph/exercices/en/langage-c/178/exercices/corriga-c/s/f-z5VLTSRdo.pdf