Page 96 - PortGPT_V2.1_C8_Flipbook
P. 96

test Your skiLLs




                  1.  Tick ( ) the correct option.

                      a.  Which of the following conditional statements is used to test multiple conditions?

                           (i)  if                                                (ii)  if…else
                           (iii)  Nested if                                       (iv)  All of these

                      b.  What will be the output of the following code?

                           if(true)
                           {
                               document.write("Hello");
                           }

                           else
                           {
                               document.write("Hi");

                           }
                           (i)  Hello                                             (ii)  Hi
                           (iii)  Hello Hi                                        (iv)  Nothing will print

                      c.  Which of the following is not the conditional statement in JavaScript?

                           (i)  if Statement                                      (ii)   if…else Statement
                           (iii)   if...elif...else Statement                     (iv)  None of these

                      d.  What is the answer of the expression, 2**2**2?

                           (i)  2                                                 (ii)  16
                           (iii)  4                                               (iv)  8

                      e.  If a = 20 and b = 10, then what will be the output of the following code:

                           if (false)
                           {
                               document.write(a+b);

                           }
                           else
                           {
                               document.write(a-b);

                           }
                           (i)  30                                                (ii)  20

                           (iii)  10                                              (iv)  Nothing will print



                  94    Premium Edition-VIII
   91   92   93   94   95   96   97   98   99   100   101