1.

Predict the relevant output for the given set of code.
 static void Main(string[] args) { float sum; int i; sum = 0.0F; for (i = 1; i <= 10; i++) { sum = sum + 1 /(float)i; } Console.WriteLine("sum =" +sum); Console.ReadLine(); }

A. 2.000
B. 2.910
C. 2.928
D. 3.000
Answer» D. 3.000


Discussion

No Comment Found