Tuesday, September 8, 2009

AMICABLE PAIRS PROGRAM IN C


Two numbers are said to be amicable if sum of proper divisors of 1st is equal to the 2nd and vice versa. It is assumed that these two numbers shoud be distinct, e.g. 3 is equal to the sum of its proper divisors 1 and 2 but can not form an amicable pair.





#include

int main()

{

long int range, test, chk, div, sum, n1, n2;

printf("Input range to check amicable numbers: ");

No comments:

Post a Comment