0 like 0 dislike
asked in Computer Science by (474k points)
What is meant by variable? Discuss different rules for naming variables in GW-BASIC.

1 Answer

0 like 0 dislike
answered by (474k points)
Variables: Variables are the names that you have chosen to represent values used in a GW-BASIC program. The value of a variable may be assigned specifically, or may be the result of calculations in your program. If a variable is assigned no value, GW-BASIC assumes the variable's value to be zero. GW-BASIC variable names may be any length; up to 40 characters are significant. The characters allowed in a variable name are letters, numbers, and the decimal point. The first character in the variable name must be a letter. Special type declaration characters are also allowed. Reserved words (all the words used as GW-BASIC commands, statements, functions, and operators) can't be used as variable names. However, if the reserved word is embedded within the variable name, it will be allowed. Variables may represent either numeric values or strings.

Rules for Naming a Variable in GW-Basic

1. A Variable name cannot be more than 40 characters.

 2. The name of Variable may contain alphabets (both lower case and upper case) numbers and decimal points. 3. The first character in name of Variable must be an Alphabet.

 4. Key /Reserved words of BASIC cannot be used as Variables.

 5. Blank space is not allowed in names of Variables.

6. Last character of variable name should indicate the type of variable.
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute:

10.2k questions

9.2k answers


3.2k users


Free Hit Counters