Which loop computes the sum of 1/2 + 2/3 + 3/4 + 4/5 + … + 99/100?

(A) For n As Integer = 1 To 99
s += n / (1 + n)
Next
(B) For q As Integer = 100 To 1
s += (q + 1) /q
Next
(C) For d As Integer = 2 To 99
s = 1 / d + d / (d + 1)
Next
(D) For x As Integer = 1 To 100
s += 1 / (x + 1)
Next

(A) For n As Integer = 1 To 99
s += n / (1 + n)
Next

Computer Science & Information Technology

You might also like to view...

If b is an integer and d is a double-precision number, the evaluation of the expression b*d is a(n) ____ value.

A. integer B. float C. real D. double-precision

Computer Science & Information Technology

To create a DTD or a schema, you need access to a _____.

A. ?word processor B. ?spreadsheet program C. ?text editor D. ?WYSIWYG authoring program

Computer Science & Information Technology