**Parameter: Any number
Output: The number with its digits in the reverse order
**

`<html>`

```
```

`<--script type ="text/javascript">`

function rev_num()

{

var num = prompt("Enter the number to be reveresed :", " ");

var n= num;

var rev = 0, rem;

while (n>0)

{

rem = n % 10;

rev = rev * 10 + rem ;

n = Math.floor(n/ 10);

}

document.write("The given number is : " +num+ " <br/> The reverse of the given number is : " +rev+ "\n");

}

<–/script>

<body style=”background-color : grey” on-Load= “rev_num();”> //on-Load should be onload

<body>

</html>

**Output:**

Enter the number to be reversed : 671(prompt appears)

The reverse of the given number is : 176

very nice. for java examples, visit http://java2novice.com site