Page 243 - Data Science class 11
P. 243

Solved Exercise


                 Objective Type Questions (Section A)


            A.  Tick ( ) the correct option.

               1.  What is the correct syntax to output “Hello World” in R?
                  a.  print(“Hello World”)                           b.  ”Hello World”
                  c.  ’Hello World’                                  d.  All of these

               2.  Which of the following is not true?
                  a.  Arithmetic statement and arithmetic functions are the same
                  b.  R is case-sensitive while writing the codes

                  c.  R was specially designed for data science purposes
                  d.  All of these

               3.  How do you insert COMMENTS in R code?
                  a.  # This is a comment                            b.  /* This is a comment
                  c.  // This is a comment                           d.  All of these

               4.  In R, you must declare the data type of a variable:
                  a.  False                                          b.  True

                  c.  Not sure                                       d.  Only for certain variable types

               5.  How do you create a variable named x with the numeric value of 10?
                  a.  x <- 10                                        b.  int x = 10
                  c.  x : 10                                         d.  10 -> x

               6.  How can you assign the same value to multiple variables in one line?
                  a.  var1, var2, var3 <- “Orange”                   b.  var1, var2, var3 = “Orange”
                  c.  var1 <- var2 <- var3 <- “Orange”               d.  All of these

               7.  Which operator is used to add together two values?
                  a.  The + sign                                     b.  The * sign

                  c.  The & sign                                     d.  The # sign
               8.  What is the data type of s: 12.6, 2355 and 787?
                  a.  numeric                                        b.  integer

                  c.  complex                                        d.  None of these
               9.  Which operator can be used to compare two values?
                  a.  ==                                             b.  =

                  c.  ><                                             d.  <>








                                                                                         Programming with R    241
   238   239   240   241   242   243   244   245   246   247   248