+ 2

what are armstrong numbers??

26th Oct 2016, 4:23 PM
2 odpowiedzi
+ 6
Armstrong Numbers are three digit numbers whose sum of cubes of Individual digits is equal to the number itself. say for e.g. 135 1^3+3^3+5^3= 135. So it's an Armstrong Number. If you wanted the logic to know whether a number is Armstrong or not then: . . . //where x is the number to be checked int th=x/100; int hu=(x%100)/10; int one=x%10; int sum=th^3+hu^3+one^3; if (sum==x) cout<<"Number is Armstrong Number"; ...
26th Oct 2016, 4:55 PM
Anbu Coder
Anbu Coder - avatar
+ 1
Armstrong Numbers need not be a three digit number. ex: for any number number=(first digit)^number of digits+.......
31st Jan 2017, 2:57 PM
sai pranav
sai pranav - avatar