Armstrong number

#include<bits/stdc++.h>
using namespace std;
int main()
{ int m=0,sum=0;
unsigned long long n,k;

cin>>n;
k=n;
while(k!=0)
{
k/=10;
m++;
}
cout<<m<<endl;
k=n;
while(k!=0)
{
int j=k%10;
k/=10;
sum+=pow(j,m);
}
if(sum==n)
cout<<“True”;
else cout<<“False”;
return 0;

}

code is giving false by giving input 153

@Ashish2001
Your code is correct. Just comment out cout<<m<<endl;
change “False” to “false” and “True” to “true”

i did it but not getting true by passing 153

@Ashish2001
Bro it is returning true for 153


What’s the exact doubt? I think you got 100 score

yes, i got 100 but it didn’t worked on the code blocks

please tell me how to remove this bug as it is only showing false with 153 else armstrong no. are showing true

@Ashish2001
I think there is some problem with codeblocks. Try using some other ide because it is working fine on sublime as well.

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.

Is there any alternative of mingw on windows