Failed 3 test cases

#include
using namespace std;

int isarmstrong(int num)
{
int counter=0,mod,sum=0;
while(num>0)
{
num = num/10;
counter++;
}
while(num>0)
{
mod = num%10;
sum = sum + (mod*counter);
num = num/10;
}
if(sum==num)
{
cout<<“true”<<endl;
}
else
{
cout<<“false”<<endl;
}
}

int main() {
int num;
cin>>num;
isarmstrong(num);
return 0;
}

@sroy3166 Save your code on ide.codingblocks.com and then please send me the link. and can you tell me your understanding of armstrong number.