Page 23 - Modular_V2.0_C++_Flikpbook
P. 23

Exercise



                 A.   Tick ( ) the correct option.
                      1.  Which of the following symbols can be used in a variable name?

                          a.  Underscore ( _ )                         b.  Plus ( + )
                          c.  Asterisk ( * )                           d.  None of these

                      2.  Which of the following is an invalid variable name?
                          a.  User_Name                                b.  Priya $pay
                          c.  Name                                     d.  Name123

                      3.  …………………….. are the smallest individual units of a C++ program.
                          a.  Tokens                                   b.  Code
                          c.  Symbols                                  d.  Letters

                      4.  …………………….. are special words in C++ that have a fixed meaning and cannot be used as
                          variable names.
                          a.  Variables                                b.  Operators

                          c.  Constants                                d.  Keywords
                      5.  Which of the following is a special symbol used to perform calculations?
                          a.  Operators                                b.  Constants

                          c.  Operands                                 d.  Delimiters

                      6.  Which of the following is not a primitive data type?
                          a.  int                                      b.  float
                          c.  double                                   d.  struct

                      7.  Which of the following delimiters is used to terminate each line of a program?
                          a.  Colon                                    b.  Equal to
                          c.  Comma                                    d.  Semicolon

                 B.   Write ‘T’ for true and ‘F’ for false.

                      1.  Equal sign is used to assign a value to a variable.                           ……………………

                      2.  C++ allow some of special characters in its coding called delimiters or punctuators.  ……………………

                      3.  A string value is a collection of one or more characters.                     ……………………

                      4.  An integer constant is a numeric value with fractions.                        ……………………

                      5.  A constant is a variable value which can change during the program execution.   ……………………









                                                                                                                  21
                                                                                         Getting Started with C++
   18   19   20   21   22   23   24   25   26   27   28