Page 378 - Web Applications (803) Class 11
P. 378

alert(“Congratulations on passing the exam”);
                     }
                     else
                     {
                             alert(“You failed, try harder next time”);
                     }
                   </script>
                   </body>
                   </html>
                   On running the above program, we get the following output:











































                22.  To find out if the student is selected for the college or not based on the given conditions –

                    i.   Selected if age > 18 and marks > 65.
                    ii.  Not selected if age > 18 and marks < 65.
                    iii.  Not selected if age < 18.

               Ans.  <!DOCTYPE html>
                   <html>
                   <head>
                     <title> Nested if Statement </title>
                   </head>
                   <body>
                   <script>
                     var name = prompt(“Enter the name of the student: “);
                376   Touchpad Web Applications-XI
   373   374   375   376   377   378   379   380   381   382   383