Array in GW Basic
Array is defined as sub-scripted variable which contains lower bounds and upper bounds .It has a starting and ending position.
There are two type of Array in GW Basic
Single Dimensional Array in GW BAsic
The array in which we use one subscript is called single dimensional array .Only one loop is used in array. It consist on one column or one row. It is also known list array, linear array and vector array.
10 let n (1) =10
20 let n (2) =20
30 print n (1)
10 for k =1
20 read n$(K)
30 print n$(k)
40 next k
50 data ahead najam adil rauf awais
“If you have any problem then don’t forget to watch GWBASIC in URDU Video “
Two dimensional array in GW Basic
The array in which we use two subscript and two loops are used in two dimensional array and it is consist of on column and row. It is two dimensional matrix which has two or more rows or columns.
Two dimensional array
What is dim statement in GW Basic ?
Dim is used to declare the size of array .It is used for both single dimension array and multidimensional array.
10 dim b (3)
This statement is used to create a single dimension array in memory with 3 subscript.
10 dim N (10)
20 for I=1 to 11
30 input N (1)
40 next I
50 print “good”
10 dim z (2, 5)
This statement will create double dimension array in memory each with 10 subscript.
if you still have any problem in any article of GW Basic you contact us any time for nay kind of help.
GWBASIC in URDU Part 5 Video