Write a program to check a number is armstrong or not
#include<iostream>
using namespace std;
int main()
{
int sum=0,n,r,c,i=1;
cout<<"enter the number: ";
cin>>n;
c=n;
while(i<=n)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(sum==c)
{
cout<<"armstrong number";
}
else
{
cout<<"not armstrong number";
}
return 0;
}