Wednesday 22 August 2012

Armstrong number | javascript program to find armstrong number

javascript program to find armstrong number

<script>

var n=prompt("enter the number");
n1=n;

var sum=0,r;
while(n!=0)
{
r=n%10;
sum=sum+(r*r*r);
n=parseInt(n/10);
}
if(sum==n1)
alert("number is armstrong");
else
alert("number is not armstrong");

</script>
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: