A lottery is a form of gambling where numbers are drawn to determine a prize…