i want to know what is wrong in this program...why is error showing..?
Home
/
Computer Science
/
i want to know what is wrong in this program...why is error showing..?
i want to know what is wrong in this program...why is error showing..?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Here is the program for armstrong numbers
class armstrong
{
public static void main(int a)
{
int n=a,sum=0;
while(n>0)
{
int rem=n%10;
int p=(int)(Math.pow(rem,3));
sum+=p;
}
if(a==sum)
System.out.println("Armstrong");
else
System.out.println("Not Armstrong");
}
}