Page 21 - Modular_V1.1_Flipbook
P. 21

Primitive data types are built-in or predefined data types.

                       Variables are memory locations used to store values.
                       A constant is a fixed value which does not change during the program execution.
                       C++ allows some special characters in its coding called delimiters or punctuators.

                       Operators are special symbols in C++ that are used to perform calculations.



                                                        Exercise



                 A.   Tick (3) the correct option.

                      1.  Which of the following symbols can be used in a variable name?
                          a.  Underscore ( _ )                             c.  Asterisk ( * )
                          b.  Plus ( + )                                  d.  None of these

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

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

                      4.  …………………….. are the reserved words which cannot be used as variable names.
                          a.  Variables                                    c.  Constants
                          b.  Operators                                   d.  Keywords

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

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

                      7.  Which of the following delimiters is used to terminate each line of a program?
                          a.  Colon                                        c.  Comma
                          b.  Equal to                                    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.                     ……………………




                                                                                         Getting Started with C++   19
   16   17   18   19   20   21   22   23   24   25   26