Saturday, 29 March 2014

Program To Check Whether Given Two Numbers Are Amicable Numbers or Not

/*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. Such a pair is (220, 284).*/

 int num1, num2, i, t1=0,t2=0;
 printf("Enter two numbers to check whether they are amicable numbers or not. --> ");
 if(t1==num2 && t2==num1)
  printf("\(%d,%d\) are amicable numbers.",num1,num2);
  printf("\(%d,%d\) are not amicable numbers.",num1,num2);


No comments:

Post a Comment