Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 91 - 2625 PortGPt V2.1
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 |