The W3Schools JavaScript Math Tutorial has clues on how to complete this assignment

Enter a positive integer

 

 

 

ded