πŸ“Š Visual Basics
Q. The intNums array is declared as follows: Dim intNums() As Integer = {10, 5, 7, 2}. Which of the following blocks of code correctly calculates the average value stored in the array? The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.
  • (A) Do While intSub < 4 intNums(intSub) = intTotal + intTotal intSub = intSub + 1 Loop dblAvg = intTotal / intSub
  • (B) Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub
  • (C) Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub − 1
  • (D) Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / (intSub − 1)
πŸ’¬ Discuss
βœ… Correct Answer: (B) Do While intSub < 4 intTotal = intTotal + intNums(intSub) intSub = intSub + 1 Loop dblAvg = intTotal / intSub

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
65
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Praveen Singh
Publisher
πŸ“ˆ
87%
Success Rate