<! DOCKTYPE html> <!--Take input From the user and Check whether the number is odd or even--> <html> <head> <title> Check Odd or even </title> </head> <body> <center> <h3> ODD OR EVEN CHECKER </h3> </center> <script> var num; num =prompt("Enter your Number You want to check"); if(num%2==0) { document.write("The number is a Even Number and the number is"+num); } else { document.write("The number is a odd number and the number is"+num); } </script> </body> </html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter