answersLogoWhite

0

,

this answer is not perfect, its logic is correct. Validation for a floating point number has to be done. Change the code urself..

import java.io.*;

class proper

{

public static void main(String args[])

{

try

{

System.out.println("Enter the number");

InputStreamReader isr = new InputStreamReader(System.in);

BufferedReader br = new BufferedReader(isr);

String str = br.readLine();

int n = Integer.parseInt(str);

int b[]=new int[n];

if(n>0)

{

for(int i=1;i

{

if(n%i == 0)

{

b[i]=i;

}

}

System.out.print("Proper divisors of " + n + " are");

for(int i=1;i

{

System.out.print(b[i]);

}

}

else

{

System.out.println("please enter a positive number");

}

}catch(Exception e)

{

System.out.println("Caught exception " + e);

}

}

}

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

What is the seventh perfect number?

a perfect number is defined as a positive integer which is the sum of its proper positive divisors, that is, the sum of the positive divisors excluding the number itself 137,438,691,328 is the 7th perfect number.


How many proper divisors does 120000 have?

120,000 has 70 proper divisors.


What is a perfect Abundant Or dificient number?

A perfect number equals the sum of its proper divisors. A deficient number is greater than the sum of its proper divisors. An abundant number is less than the sum of its proper divisors. Proper divisors of a number do not include the number itself.


What are the proper divisors for 24?

1,2,3,4,6,8,12,24


Proper factors of ten?

The factors of 10 are 1, 2, 5, and 10. The proper factors, or divisors, of the integer n are the positive factors of n other than n itself. So, the proper factors of ten are 1, 2, and 5.


How is 8589869056 a perfect number?

8589869056 is not a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. In the case of 8589869056, the sum of its proper divisors is less than the number itself, making it an abundant number, not a perfect number.


How many proper divisors are in 7920?

59


What are all the perfect numbers 1 - 300?

-299


Are 1184 and 1210 friendly?

Yes, 1184 and 1210 are considered friendly numbers. Friendly numbers, or amicable numbers, are pairs of numbers where each number is the sum of the proper divisors of the other. For 1184, the sum of its proper divisors is 1210, and for 1210, the sum of its proper divisors is 1184, confirming their amicable relationship.


What is the term for equal to the sum of its proper factors?

A perfect number is the term for a number that is equal to the sum of its proper divisors. Be careful not to confuse that with proper factors. Proper divisors include 1 but not the number itself. Proper factors don't include either I or the original number.


Is 19 composite?

no- 19 is prime which means it has no proper divisors.


What are the proper divisors of 81?

1, 3, 9 and 27