Page 91 - PortGPT_V2.1_C8_Flipbook
P. 91

if(number % 2 ==0)

                       {
                               document.write("Lucky number");
                       }
                       else
                       {

                               document.write("Not a lucky number");
                       }
                     }

                     else
                     {
                       document.write("Try again..............");
                     }

                 </SCRIPT>
                 </BODY>
                 </HTML>
                 On running the above program, we get the following output:


















































                                                                                 Conditional Statements in JavaScript  89
   86   87   88   89   90   91   92   93   94   95   96