Simple Javascript program that reads a number and display whether it is odd or even. - Anna University Multiple Choice Questions

Simple Javascript program that reads a number and display whether it is odd or even.

This is one of the simple Javascript program that reads an integer and display whether it is odd or even - Javascript program to find whether the given number is odd or even.
JavaScript Tutorial
JavaScript Tutorial

  • Copy the above given coding and save it as anyname.html
  • Open the saved file in any web browser.
  • You will get an output like shown below.
Output:
Javascript odd even output windows
Javascript odd even output windows
Here prompt dialogue box is used to get input from the user and the result is displayed in the alert dialogue box.

No comments:

Post a Comment