You are viewing a single comment's thread. Return to all comments →
foreach(int number in arr) { if (number>0) { positives+=1; } else if (number<0) { negatives+=1; } else { zeros+=1; } } System.Console.WriteLine("{(negatives/arr.Count):F6}"); System.Console.WriteLine($"{(zeros/arr.Count):F6}");
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
foreach(int number in arr) { if (number>0) {
positives+=1; } else if (number<0) { negatives+=1; } else { zeros+=1; }
} System.Console.WriteLine("{(negatives/arr.Count):F6}"); System.Console.WriteLine($"{(zeros/arr.Count):F6}");