Program to check whether a number is Abundant number or not | faceprep

Program to check whether a number is Abundant number or not | faceprep

A program to check whether a number is an Abundant number or not is discussed here. An abundant number is a number for which the sum of its proper divisors is greater than the number itself.

Program to check whether a number is Abundant number or not


Input & Output format:

  • Input consists of 1 integer.
  • If it is an Abundant number display Abundant Number or display Not Abundant Number.

Sample input:

12

Sample Output:

Abundant Number

Explanation:

The divisors of 12 are 1, 2, 3, 4 and 6.

The sum of divisors of 12 is 16.

12 < 16. Hence, 12 is an abundant number.


program to check whether a number is abundant number or not ad banner

Algorithm to check whether a number is an abundant number or not

  • Input a number from the user.
  • Find the sum of its divisors.
  • If sum < num, print “Abundant Number”.
  • Else, print “Not Abundant Number”.


Program to check whether a number is an abundant number or not

@@coding::1@@


face prep pro ad banner


Recommended Programs


Program to check whether a number is Abundant number or not

c