ABUNDANT NUMBER OR NOT
Consider the following I/O samples.
SAMPLE INPUT: 96
SAMPLE OUTPUT: ABUNDANT NUMBER
A number is called ABUNDANT NUMBER is a positive integer such that the sum of its proper divisors is greater than the number itself.
12 = 1+2+3+4+6 = 16
16>12
16>12
C PROGRAM:
#include<stdio.h>
int main()
{
int num, temp, sum=0,i;
scanf("%d",&num);
for(i=1;i<num;i++)
{
if(num%i==0)
sum+=i;
}
if(num<sum)
printf("Abundant number");
else
printf("Not Abundant number");
return 0;
}
#include<stdio.h>
int main()
{
int num, temp, sum=0,i;
scanf("%d",&num);
for(i=1;i<num;i++)
{
if(num%i==0)
sum+=i;
}
if(num<sum)
printf("Abundant number");
else
printf("Not Abundant number");
return 0;
}
OUTPUT:

The given source code in C program "FOR ABUNDANT NUMBER OR NOT" is short and simple to understand. The source code is well tested in DEV-C++ and is completely error free.

The given source code in C program "FOR ABUNDANT NUMBER OR NOT" is short and simple to understand. The source code is well tested in DEV-C++ and is completely error free.
If you have any feedback about this article and want to improve this, please comment in the comment section.
Comments
Post a Comment