Former US President Jimmy Carter says recent liver surgery revealed that he has cancer and it has spread to other parts of his body.