Input
Output
#include <iostream> using namespace std; int main() { int n = 371,r,sum=0,t; cout << "Enter the number: "; cout << n << endl; t=n; while(t>0) { r=t%10; sum=sum+(r*r*r); t=t/10; } if(n==sum) { cout << n << " is armstrong number."; } else { cout << n << " is not armstrong number."; } return 0; }