1) The proper divisor of an integer N are the positive divisor less than N, a positive integer is said to be DEFiCiENT, PERFECT, or ABUNDANT numbers if the sum of it's proper divisor is less than, equal to or greater than the number respectively. Write a program using function call by reference to input integer N and call function COMPUTE to determine of integer N is DEFiCiENT, PERFECT or ABUNDANT. EXAMPLE : Input n: 8 Proper divisors are 1,2,4 sum of proper divisors: 1 + 2 + 4 = 7 7<8 is DEFiCiENT Input N: 6 Proper Divisors are 1,2,3 Sum of proper divisors; 1 + 2 + 3 = 6 6=6 is PERFECT Input N: 12 Proper divisors are 1, 2, 3, 4,6 Sum of proper divisors : 1 + 2 + 3 + 4 + 6 = 16 16 > 12 ABUNDANT Kindly answer this )
Code: void COMPUTE(int N) { int i, sum = 0; printf("Proper divisors are: "); for (i = 1; i < N; i++) { if (N % i == 0) { if (i > 1) { printf(", "); } printf("%d", i); } } printf("\n"); printf("Sum of proper divisors: "); for (i = 1; i < N; i++) { if (N % i == 0) { if (i > 1) { printf(" + "); } printf("%d", i); sum += i; } } printf(" = %d\n", sum); if (sum < N) { printf("%d < %d is DEFICIENT\n", sum, N); } else if (sum > N) { printf("%d > %d is ABUNDANT\n", sum, N); } else { printf("%d == %d is PERFECT\n", sum, N); } }