Space for google add

To display odd or even number .

 


       Write JavaScript code to display odd or even number. (Using if else statement)


Programme:-

 

<html>

      <body>

<h2><center><font face="algerian">To display odd or even number.

</h2></center></font>

           <script language="javascript">

            var a

           a=prompt("enter a","a")

           a=parseInt(a)

            if(a%2==0)

        {

 

           alert("a is even")

 

       }

    else

 

       {

           alert("a is odd")

        }

             </script>

       </body>

</html>


Output :-

       





Post a Comment

0 Comments