Armstrong number

Please show me the error. All testcases are failing.

#include
using namespace std;

long long int pow(long long int rem,long long int count){
long long int i, c = 1, temp;
for(i = 1;i<=count;i++){
temp = rem;
c = c*temp;
}
return c;
}

void Armstrong_number(long long int n){
long long int ans = 0, count = 0;
int a = n;
while(n!=0){
long long int rem = n%10;
count++;
n/=10;
}
n = a;
while(n!=0){
long long int rem = n%10;
ans+= pow(rem,count);
n/=10;
}
if(a==ans){
cout<<“True”<<endl;
}
else{
cout<<“False”<<endl;
}
}

int main(){
long long int n;
cin>>n;

Armstrong_number(n);

return 0;

}

hi @karanaggarwal708_71435e604edb5689 write “true” instead of “True” (small letters) same with false

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.