Is armstrong number

#include
#include <math.h>
using namespace std;
int main() {
int num,temp;
cin>>num;
temp=num;
int n=0;
int rem=0;
int sum=0;
while(temp>0)
{
rem=temp%10;
num=num/10;
n++;
}
temp=num;
rem=0;
sum=0;
while(temp>0){
rem=temp%10;
sum=sum+pow(rem,n);
temp=temp/10;
}
if(sum==num)
{
cout<<“true”<<endl;
}
else
{
cout<<“false”<<endl;
}
return 0;
}

it is showing timelimit error

is got my mistake… thanks

@chaman9 please mark your doubt as resolved if you have figured it out :slight_smile: