Page 290 - Data Science class 11
P. 290

<Name>Raj Singh</Name>

                    <City>Delhi</City>
                  </employ>

                  <employ>
                    <EmpId>E002</EmpId>
                    <Name>Pankaj</Name>

                    <City>Mumbai</City>
                  </employ>

                  <employ>
                    <EmpId>E003</EmpId>
                    <Name>Rahul Sharma</Name>

                    <City>Delhi</City>
                  </employ>

                  <employ>
                    <EmpId>E004</EmpId>

                    <Name>Priya Rao</Name>
                    <City>Noida</City>
                  </employ>

               </employees>
          10.  Basic Arithmetic

               a. What is the result of 5 + 3 in R?
          Ans.  Output is
              [1]  8

               b. Calculate the product of 7 and 4 using the * operator.
          Ans.  Output is
              [1]  28

               c. Determine the result of 12 / 2 using the / operator.
          Ans.  Output is
              [1]  6

          11.  Operator Precedence

               a. Explain the order of operations in R when evaluating the expression 6 + 2 * 3.
          Ans.  The order of precedence is, first multiplication and then addition. The result is 2*3=6, then 6+6=12.

               b. Evaluate the expression 4 * (7 - 2) and provide the result.
          Ans.  (7-2)=5
              4*5=20





          288   Touchpad Data Science-XI
   285   286   287   288   289   290   291   292   293   294   295