Page 83 - Modular_V1.1_Flipbook
P. 83

Exercise



                 A.   Tick (3) the correct option.
                      1.  Which of the following is a block of code to perform a particular task?

                          a.  Function                                     c.  Operator
                          b.  Header file                                 d.  None of these
                      2.  Predefined functions are called ……………………. functions.
                          a.  Built-in                                     c.  User-defined

                          b.  Both a and b                                d.  None of these
                      3.  Which of the following is like a placeholder?

                          a.  Variable                                     c.  Function
                          b.  Parameter                                   d.  Block
                      4.  ……………………. a function means giving a body of the function.
                          a.  Defining                                     c.  Prototyping

                          b.  Declaring                                   d.  Calling
                      5.  Which of the following is called an actual argument?

                          a.  Parameters passed at the time of calling a function
                          b.  Parameters passed at the time of declaring a function
                          c.  Both a and b
                          d.  None of these

                      6.  There are two methods to call a function: call by value and ……………………. .
                          a.  Call by reference                            c.  Call by argument
                          b.  Call by parameter                           d.  All of these

                 B.   Write ‘T’ for true and ‘F’ for false.
                      1.  A function allows you to reuse the code many times.                           ……………………

                      2.  The functions written in the header files are called library functions.       ……………………
                      3.  Call by value is a technique of passing the values of variables instead of
                          actual variables to a function while calling it.                              ……………………

                      4.  Local variables can be accessed outside the function in which they are declared.  ……………………
                      5.  Global variables can be declared inside a function.                           ……………………

                 C.   Fill in the blanks using the words given below.


                                          reference, scope resolution, definition, functions, arguments


                      1.  The (::) is known as …………………… operator.
                      2.  In call by …………………… technique, reference or memory address of variables are passed to a
                          function.


                                                                                               Functions in C++   81
   78   79   80   81   82   83   84   85   86   87   88