Armstrong Number Doubt

#include
using namespace std;
bool checkArmstrongNumber(int num);

int main(){
int N;
bool flag;

cin>>N;

flag = checkArmstrongNumber(N);
if(flag ==true)
cout<<“true”;
else
cout<<“false”;

return 0;
}
bool checkArmstrongNumber(int N) {
int temp, sum=0, digit;
bool isArm;

temp =N;
while(temp != 0) {
digit = temp % 10;
sum = sum +(digit * digit * digit);
temp = temp/10;
}
if (sum==N)
isArm =true;
else
isArm =false;

return isArm;
}

This code is compiling successfully, but it shows that 2 test cases fails and I’m not getting full marks.Why this is happening?

hello @ayushtiwari12

pls share ur code using cb ide

In which mail ID should i sent?

@ayushtiwari12

go to this link->https://ide.codingblocks.com
paste ur code in the editor
press ctrl+s and save
a link will be generated in ur search bar share that link with me

Sir I did not get full marks for this question.

share ur code using cb ide , i will check

image
read this line carefully.
u have misunderstood the armstrong definition

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.