Tuesday, 21 August 2012

class arm
{
public static void main(String arg[])
{
int n,t,s,r;
n=Integer.parseInt(arg[0]);
t=n;
s=0;
while(n>0)
{
r=n%10;
s=s+(r*r*r);
n=n/10;
}
if(t==s)
{
System.out.println("Given no. "+t+" is an armstron");
}
else
{
System.out.println("Given no. "+t+" is not anarmstron");
}
}
}

0 comments:

Post a Comment

Blogroll

Blogger templates

About