Computer Science, asked by satyanarayanmoh, 1 year ago

Write a program to check whether a no. is a perfect no. or not

Answers

Answered by Obaidnasim
1
Why do u waste this points in asking.
i will helpvu out just google it yar sab mil jayega. ok
see type this,
how to check wether a no. is perfect or not.
a advice always explain the Q. properly.
Answered by jithinayalloor
0

Answer:

import java.util.*;

class PerfectNoS

{

   public static void main()

   {

   

   

   int s;

   for (int n=0;n<=1000;n++)

   {

       s=0;

       for(int i=1;i<n;i++)

       {

           if(n%i==0)

           s=s+i;

       }

       if(s==n)

       System.out.println(n + "is Perfect no");

       else

       System.out.println(n + "is not perfect");

   }

}}

Explanation:

Similar questions