1 help with for statement names integer array with 20 elements display the elements 5346650
1. Help with For Statement names integer array with 20 elements. display the elements in the array
2. Question / Request : Look at Example, Look at my Code… did I accomplish the task.
My Code:
Declare integer names[20]
Declare integer index = 0
Declare integer counter = 1
For counter = 1 to 20
Display names[counter]
counter = counter + 1
done
End For
Example:
In the example provided below. I need to understand the intent of the for statement below.
What does i Represent below I Step 2: is this suppose to be the counter
is Step 3 declaring a starting value for i
Step 1. Declare names as the Integerarray of size 20.
Step 2. Declare i as integer
Ste 3. Set i = 1
Step 4.
LOOP: for i = 1to 20 incrementby 1
do
Display names[i]
done
End LOOP
End Program