Is armstrong number(functions q)

#include
#include
using namespace std;
int order(int x)
{
int n = 0;
while (x)
{
n++;
x = x/10;
}
return n;
}

// Function to check whether the given number is
// Armstrong number or not
bool isArmstrong(int x)
{
// Calling order function
int n = order(x);
int temp = x, sum = 0;
while (temp)
{
int r = temp%10;
sum += pow(r, n);
temp = temp/10;
}

// If satisfies Armstrong condition
return (sum == x);

}

// Driver Program
int main()
{
int x = 153;
bool r= isArmstrong(x);
if(r==1)
{
cout<<“true”<<endl;
}
else
{
cout<<“false”<<endl;
}
return 0;
}
all test case are not passing

@gandhivaibhav01_1acde66cce1e5144 you have to take user input for x

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.