Program to determine whether a given number is an abundant numberThe abundant number can be called as an excessive number and defined as the number for which the sum of its proper divisors is greater than the number itself. A first abundant number is the integer 12 having the sum (16) of its proper divisors (1, 2, 3, 4, 6) which is greater than itself (12). Examples: 12, 18, 20, 24, 30, 36 In this program, we have to check whether a given number is an abundant number using the algorithm given below. AlgorithmMAIN
CheckAbundant (n)
GetSum(n)
Java programOutput: Enter the number? 20 The number is Abundant C programOutput: Enter the number? 34 The number is not Abundant. Python Program:Output: Enter the number?24 The number is Abundant. C# programOutput: Enter the number? 67 The number is not Abundant. PHP ProgramOutput: Enter the number? 56 The number is Abundant. Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India