write a javascript program to accept a number form user and check whether it is armstrong number or not
Answers
Answered by
0
Answer:
import java.util.*;
public class Armstrong no.
{
public static void main(String args [])
{
Scanner.in= new Scanner (Sysrem.in);
int a,n,s=0
System.out.println(Enter a number);
n=in.nextInt();
do
{
a=n%10;
s=s+(a*a*a);
n=n/10;
}
while(a!=0);
if(n=s)
System.out.println(n+"is an Armstrong number");
else
System.out.println(n+"is not an Armstrong number");
}
}
Similar questions
English,
15 days ago
English,
15 days ago
India Languages,
15 days ago
Math,
30 days ago
English,
30 days ago
India Languages,
8 months ago