Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 82 - 2625 PortGPt V2.1
P. 82

    On running the above program, we get the following output:

                       Program 2: To demonstrate the if statement.

                      <!DOCTYPE HTML>

                      <HTML>
                      <HEAD>
                          <TITLE> if statement </TITLE>
                      </HEAD>
                      <BODY>

                      <SCRIPT>
                        var days = parseInt(prompt("How many days are there in a leap year?"));
                        if(days == 366)

                        {
                          document.write("Your answer is correct, Good Job.");
                        }

                      80    Premium Edition-VIII

| 77 78 79 80 81 82 83 84 85 86 87 |