You are viewing a single comment's thread. Return to all comments →
C# : public static void plusMinus(List arr) { decimal positive =0; decimal negative = 0; decimal zero =0 ; int total= arr.Count;
for (int i = 0; i < total; i++ ){ if (arr[i] > 0){ positive++;} else if (arr[i] <0){ negative++;} else {zero++;}}
Console.WriteLine(positive /total); Console.WriteLine(negative /total); Console.WriteLine(zero / total);
else {zero++;}}
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 →
C# : public static void plusMinus(List arr) { decimal positive =0; decimal negative = 0; decimal zero =0 ; int total= arr.Count;
Console.WriteLine(positive /total); Console.WriteLine(negative /total); Console.WriteLine(zero / total);
Console.WriteLine(positive /total); Console.WriteLine(negative /total); Console.WriteLine(zero / total);