0

How to make a program of Armstrong number??

18th Nov 2016, 9:43 AM
bhavil mishra
3 Respostas
+ 2
You can use #include <iostream> using namespace std; int main() { int n,n1,rem,num=0; cout << "Please enter a digit " << endl; cin >> n; n1=n; while(n1!=0) { rem=n1%10; num+=rem*rem*rem; n1/=10; } if(num==n) cout << n << " is an Armstrong number"; else cout << n << " is not an Armstrong number"; return 0; }
18th Nov 2016, 1:09 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 2
what?
18th Nov 2016, 2:30 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
i don't kown
18th Nov 2016, 2:04 PM
ynge