Question: Consider the following array declaration: Dim XYZ() As Integer ={4, 7, 2, 1, 9, 5} Dim X As Integer Now consider each of the following
Consider the following array declaration:
Dim XYZ() As Integer ={4, 7, 2, 1, 9, 5}
Dim X As Integer
Now consider each of the following codes, (one at a time):
1) X = 0
For i = 0 to 5
X = X + XYZ(i)
Next
What is the value of X now?
-------------------------------------
2)X = XYZ (0)
For i = 0 to 5
If XYZ(i) > X Then
X = XYZ(i)
End If
Next
What is the value of X now?
-------------------------------------
3)X = XYZ (0)
For i = 0 to 5
If XYZ(i) < X Then
X = XYZ(i)
End If
Next
What is the value of X now?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
