Q. writes a C program to check whether given two numbers are amicable numbers or not.
Definition of Amicable numbers: Amicable numbers are two numbers so related that the sum of the proper divisors of the one is equal to the other, unity being considered as a proper divisor but not the number itself.
For example, lets a pair or two number pair is (220,284),
For the proper divisor of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110, of which the sum is 284.
And the proper divisor of 284 are 1, 2, 4, 71, 142 of which the sum is 220.
/*program to check whether given numbers are amicable or not*/
printf("Enter first number : ");
printf("Enter second number : ");
for(i=1; i<n1 ; i++)
for(i=1; i<n2 ; i++)
if(n1==s2 && n2==s1)
printf("Given numbers are Amicable Numbers");
printf("Given numbers are Not Amicable Numbers"); getch();