Site pages
Current course
Participants
General
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
Topic 6
Topic 7
Topic 8
Topic 9
Topic 10
Topic 11
Topic 12
Topic 13
Topic 14
Topic 15
Topic 16
Topic 17
Topic 18
Topic 19
Topic 20
Topic 21
Topic 22
Topic 23
Topic 24
Topic 25
Topic 26
Topic 27
Topic 28
Topic 29
Topic 30
Topic 31
Topic 32
Topic 33
Topic 34
Topic 35
Elements of BASIC Language
1.Character set
A BASIC language, as any other language, has its own alphabet or character set. All the quantities defined and used in BASIC are constructed by using the character set. The character set in BASIC are Letter → A, B, C… Z a ,b ,c …z Digits → 0, 1, 2 … 9 Special Characters → + - * / ( ) = . , $ < > ; Blanks → In the text, we shall denote a blank by the character ^. Eg. 30 PRINT “GOVIND”; “^”; “SINGH” Quote → ‘(Single Quote) or “(Double Quote) [;→ different quantities appearing in the list of the PRINT statement can be separated by semicolons] 2. Constants and Variables Constants The quantities whose value cannot be changed in a program are referred to as constants. There are two types of constants.
A constant consists of the number 0, 1, 2 … 9 There are two types A number without an explicit decimal is called integer constant (i.e. whole number). Eg. 1, 20, 300. 2.Real Constant The number includes a decimal point. Eg. 22.33. .33 is called its fractional part and 22 is its integer part. The number can be positive or negative. The sign always precedes the number. If the values is a positive number, it need not be specified as + 12.12. By default if no sign is appearing, then it is taken as a positive quantity. b.String Constant Letters and Digits enclosed with quotes. Eg. “345”, “TNAU” |
Last modified: Wednesday, 18 January 2012, 11:14 PM