Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Armstrong number
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int num= 153; int temp= num; int sum= 0; while(num>0) { int r= num%10; sum+= r*r*r; num= num/10; } System.out.println(sum); if (temp==sum) { System.out.println("The number is Armstrong number"); } else { System.out.println("The number is not armstrong"); } } }
run
|
edit
|
history
|
help
0
Java: If, Else, While, litle program
jb11.0 threads tick tock
JAVA # Boşluklu bir metinde kaç adet boşluk var
ElaineBrown**
ChangePI
epeenconverter
classwork
smallest number and its index(position)
Java
Union of Arrays