#include<bits/stdc++.h>
using namespace std;
#define ll long long int
bool check(ll num)
{
ll temp=num;
ll sum=0;
while(num!=0)
{
ll rem=num%10;
sum+=pow(rem,3);
num/=10;
}
if(sum==temp)
return true;
else
return false;
}
int main()
{
ll num;
cin>>num;
if(check(num))
cout<<"It is a Armstrong number"<<endl;
else
cout<<"Not a Armstrong number"<<endl;
return 0;
}
when num is equal to 153 in the second iteration the value of rem is 5 but when im putting that in pow function it is giving me 124 but 5 pow 3 is equal to 125 can anyone tell me whats the issue