Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Assignment Even or Odd
- //Prompt the user to enter a number
- //Show a pop-up - "number is even/odd"
- var value = parseInt(prompt("Enter a Number"));
- if(value % 2 == 0){
- alert(value + "is even");
- }else{
- alert(value + " is odd");
- }
Add Comment
Please, Sign In to add comment