help me quick plzzz

i have to write a program that says whether the number i enter is Naracissistic or not.
i wrote the codes and everything but every time i write 153 or 24678051 it says its not a Naracissistic number :( plz tell me whats wrong with the codes i wrote :(

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253`` `````` # include # include using namespace std; bool isNarcissistic (int num1); int main() { int num1; cout << "Enter a positive number"; cin >> num1; if (isNarcissistic(num1)) cout << num1 << "is Narcissistic"; else cout << num1 << "is no Narcissistic"; return 0; } bool isNarcissistic(int num1) { int x1; int x2; int digit; int sum = 0; int i = 0; x1 = num1; while (x1 != 0) { digit = x1 % 10; x1 = x1 /10; i++; } x2 = num1; while (x2 != 0) { digit = x2 % 10; x2 = x2/10; sum = sum + pow(digit,i); } if (sum == num1) return true; else return false; }``````
Works for me, after i replaced line 45 with `sum = sum + int(pow(1.0*digit,i));`
I just wanted to make it double. pow function is defined as `double pow(double base, double exponent);` and codepad site does not like warnings