answersLogoWhite

0

<html>

<head>

<Script Language="JavaScript">

var a,n,b=0,t;

n=parseInt(window.prompt("enter n","0"));

t=n;

while(n>0)

{

a=n%10;

b=b+a*a*a;

n=n/10;

}

if(b==t)

{

document.writeln("Armstrong no");

}

else

{

document.writeln("Not an Armstrong no");

}

</script>

</head>

</html>

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake

Add your answer:

Earn +20 pts
Q: Program to check whether the given number is an Armstrong number?
Write your answer...
Submit
Still have questions?
magnify glass
imp