Some mathematical numbers are identified by different names. These names are given by different mathematicians. We can establish those numbers, logically by the Java program. For that we first know the mathematical definition of the numbers after then we must think how we can represent programmatically.
import java.util.*;
public class Amstrong100to1000
{
public static void main(String []args)
{
int n,s=0,r;
int sn=100;
int temp;
while(sn<=1000)
{
n=sn;
s=0;
while(n>0)
{
r=n%10;
s+=Math.pow(r,3);
n /=10;
}
if(s==sn)
{
System.out.println(sn + "");
}
sn++;
}
}
}