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

1 Answer

0 like 0 dislike
answered ago by (69.7k 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:

3.1k questions

2.6k answers

18 comments

2.7k users

...