#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