SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
long sum=0,x;
cout<<"Enter the value of x ";
cin>>x;
for(int i=1;i<x;i++)
if(x%i==0)
sum+=i;
if(sum>x)
cout<<"Given number is abundant number ";
else
cout<<"Given number is not abundant ";
return 0;
}
using namespace std;
int main()
{
long sum=0,x;
cout<<"Enter the value of x ";
cin>>x;
for(int i=1;i<x;i++)
if(x%i==0)
sum+=i;
if(sum>x)
cout<<"Given number is abundant number ";
else
cout<<"Given number is not abundant ";
return 0;
}
Any questions regarding to program please write in comments.
No comments:
Post a Comment