Armstrong Number



------------------------------------------------------------------------------------------------------------------
                                                                    Armstrong Number                                 Try It 🔻
------------------------------------------------------------------------------------------------------------------#include<iostream>
using namespace std;
int main()
{
int arm=0,a,d,no;

cout<<"Enter any Number : ";
cin>>no;
d=no;
while(no>0)
{
a=no%10;
no=no/10;
arm=arm+a*a*a;
}
if(arm==d)
{
cout<<"\nGiven Number "<<d<<" is Armstrong";
}
else
{
cout<<"\nGiven Number "<<d<<" is not Armstrong";
}
return 0;
}
------------------------------------------------------------------------------------------------------------------
                                                                    OUTPUT                                 Try It 🔻
------------------------------------------------------------------------------------------------------------------
Enter any Number : 121

Given Number 121 is not Armstrong

//Run Again

Enter any Number : 153

Given Number 153 is Armstrong