diff --git a/CPP/Armstrong Number Program in C++ b/CPP/Armstrong Number Program in C++ new file mode 100644 index 0000000..f43740c --- /dev/null +++ b/CPP/Armstrong Number Program in C++ @@ -0,0 +1,26 @@ +#include +#include + +void main() +{ +int arm=0,a,b,c,d,no; +clrscr(); +cout<<"Enter any num: "; + cin>>no; +d=no; +while(no>0) +{ +a=no%10; +no=no/10; +arm=arm+a*a*a; +} +if(arm==d) +{ +cout<<"Armstrong"; +} +else +{ +cout<<"not Armstrong"; +} +getch(); +}