Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 98 - 2505_CoreGPT(Podar)_Flipbook_C6
P. 98

    Types of Variables

                      The two types of variables available in BASIC-256 are:

                           Numeric  Variable:  Numeric variables are  used to store numbers for calculations. They
                          can hold integer and decimal numbers. The numeric variables that hold integers are called

                          Integer variables. The numeric variables that hold decimal numbers are called  Floating
                          variables.
                          For example: 22, -34 and 9.25

                           String Variable: Strings are a set of characters, that can be a mixture of numbers, letters and

                          other characters.
                           For  example: "Hello World!",  "123 Random Road",  "abcde",  "88 Golf Course Road"  and
                          "12345-8976"

                      Rules for Naming Variables

                      The names we  give to the variable  are  called  identifiers. Variable  name can include letters
                      (lowercase and uppercase), digits (0 to 9) and underscore (_) character. To name the variables,

                      follow the following rules:
                           Variable name should always start with a letter or underscore.
                           Variable name can only use letters, digits, underscore and Dollar ($).

                           Name of the variables should describe the values that they store.

                           String variable name should contain $ (Dollar) symbol at the end of the name. For example,
                          Name$ and Address$

                          Variable names are case sensitive i.e. Name and NAME are two different variables.
                      Program 1: To use the numeric variables.

                     96     Premium Edition-VI

| 93 94 95 96 97 98 99 100 101 102 103 |