Computer Science, asked by maria2707, 4 months ago

Q1​. ​WAP to check whether 60 is a perfect number or not and display an appropriate message "60 is a perfect number" or "60 is not a perfect number"
respectively

Answers

Answered by Anonymous
48

Answer:

hello,

its a python program

Explanation:

#program to check whether 60 is a perfect number or not and display an appropriate message

n=60

sum=0

for i in range(1,n):

   if n%i==0:

       sum+=i

if sum==60:

   print( "60 is a perfect number" )

else:

   print( "60 is not a perfect number")

hope it helps you

please mark brainliest

@ItzSnowySecret07

Answered by allysia
46

USING PYTHON:

\\\tt  n= int(in put("Enter\ a\ number : "))\\\tt sum=0\\\tt for\ i\ in\ range(1,n):\\\tt {\qquad   if\ n\%i==0:}\\\tt  {\qquad      sum+=i} \\\tt  if\ sum==n: \\\tt {\qquad   print(n,"is\ a\ perfect\ number")}\\\tt else: \\\tt  {\qquad  print(n,"is\ not\ a\ perfect\ number")}

Attachments:
Similar questions