Page 422 - Webapplication11_C11_Flipbook
P. 422

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: ");
                420   Touchpad Web Applications-XI
   417   418   419   420   421   422   423   424   425   426   427