Program to find if the given numbers are Friendly pair or not (Amicable or not)

Program to find if the given numbers are Friendly pair or not (Amicable or not)

The program to find if the given numbers are Friendly pairs or not (Amicable or not) is discussed here. Friendly Pairs are two or more numbers with a common abundance.

Program to find if the given numbers are Friendly pair or not (Amicable or not)


Input & Output format:

  • Input consists of 2 integers.
  • The first integer corresponds to number 1 and the second integer corresponds to number 2.
  • If it is a Friendly Pair display Friendly Pair or displays Not Friendly Pair.

For example,6 and 28 are Friendly Pairs.

(Sum of divisors of 6)/6 = (Sum of divisors of 28)/28.


program to find if the given numbers are friendly pairs or notClick here to learn more about FACE Prep PRO


Algorithm to check whether the given numbers are friendly pairs or not

  • Input the numbers num1 and num2.
  • Initialize sum1 = sum2 = 0.
  • sum1 = sum of all divisors of num1.
  • sum2 = sum of all divisors of num2.
  • If (sum1 == num1) and (sum2 == num2), then print “Abundant Numbers”.
  • Else, print “Not Abundant Numbers”.


Program to check whether the given numbers are friendly pairs or not

@@coding::1@@


Recommended Programs


Program to find if the given numbers are Friendly pair or not (Amicable or not)

c