armstrong number in java
int c=0,a,temp;
int n=153;//It is the number to check armstrong
temp=n;
while(n>0)
{
a=n%10;
n=n/10;
c=c+(a*a*a);
}
if(temp==c)
System.out.println("armstrong number");
else
System.out.println("Not armstrong number");
Also in Java:
- bukkit java get max players
- how to play a clip of audio in java when needed
- java function that returns the index of the largest value in an array
- how to create a java jframe
- how to pass parameters to xsl file
- java print syntax
- java android edit text set value
- java catch multiple exceptions
- how to create a circle in java
- java iterate over a string
- java split array into two
- java convert string with commas to long
- remove part of string java
- java script removing first three indexes
- how to open a text file in java
- java concatenate strings
- binary numbers java
- java mockito any string import
- android studio remove notification bar
- jackson ignore values if empty
- java random number
- take a value from keyboard java
- arraylist remove method java
- java create file