adplus-dvertising
frame-decoration

Question

What will be assigned to the dblAvg variable after the code has been executed?

Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.
Do While intSub < 4
intTotal = intTotal + intNums(intSub)
intSub = intSub + 1
Loop
dblAvg = intTotal / intSub

a.

0

b.

5

c.

6

d.

8

Answer: (c).6

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be assigned to the dblAvg variable after the code has been executed? Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the...

Similar Questions

Discover Related MCQs

Q. ________ method is used to sort an array in visual basic.

Q. Arranging data in a specific order is called as ___________

Q. __________________ method is used to reverse the values.

Q. Which of the following statements assigns (to the intElements variable) the number of elements contained in the intNums array?

Q. Which of the following assigns the string “Rover” to the fifth element in a one-dimensional array named strPetNames?

Q. If the elements in two arrays are related by their subscripts, the arrays are called as ________________ arrays.

Q. The strStates and strCapitals arrays are parallel arrays. If Illinois is stored in the second element in the strStates array, where is its capital (Springfield) stored?

Q. A _______________ resembles a table.

Q. We can determine number of elements in two-dimensional array by _________________

Q. The _____________ in a two-dimensional array specifies the elements row and column position.

Q. Each element in a two-dimensional array is identified by a unique combination of _______________

Q. The subscripts are _________ than the row and column in which the element is located.

Q. To traverse two dimensional array you require ________________ loops.

Q. Which of the following declares a two-dimensional array that has three rows and four columns?

Q. The intSales array is declared as follows:

Dim intSales(,) As Integer = {{1000, 1200, 900, 500, 2000}, {350, 600, 700, 800, 100}}.

The intSales(1, 3) = intSales(1, 3) + 10 statement will _______________