Skip to content

VictorNjeru49/question_five-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

question_five-

<title>Document</title> <script language="javascript"> /*Question 5: Reverse Integer Write a program that takes an integer as input and returns an integer with reversed digit ordering. Examples: For input 500, the program should return 5. For input -56, the program should return -65. For input -90, the program should return -9. For input 91, the program should return 19. */
function num(){
  var number=prompt('Enter a number');
const i = parseInt
(Math.abs(number).toString().split('')
.reverse().join(''));
document.write(i);
return number < 0 ? -i : i;


}
</script> reverse to interger

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published