Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits is equal to the number itself. For example 153 is armstrong number.
1. Tutorial4us.com
Armstrong Program in C++
Armstrong number is a number that is the sum of its own digits each raised to the power of
the number of digits is equal to the number itself. Below program is Armstrong program in
c++, some time this question are asked as a c++ program to check given number is
Armstrong or not
For example 153 is Armstrong number.
#include<iostream.h>
#include<conio.h>
void main()
{
int arm=0,a,b,c,d,no;
clrscr();
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<<"Armstrong";
}
else
{