PERFECT NUMBER Q. Checking a number is perfect or not.( A number is perfect if sum of its factors, including 1 and excluding the number is the original number. eg:- 6=1+2+3 is a perfect number.) n=…