+91-85006-22255
Write a program to check whether the given number is perfect. The number is said to be perfect if the sum of its factors is equal to (2 * number). For e.g., 6 -> 1 + 2 + 3 + 6 = (2 * 6).
class IsPerfectNumber { public static void main(String s[]) { int number = 28; System.out.println("The given number is perfect Number : " + isPerfectNumber(number)); } public static boolean isPerfectNumber(int number) {
} }
Topic: for Loop In Java
Read this topic Take test on this topic
Open In App