You are viewing a single comment's thread. Return to all comments →
in c# public static void plusMinus(List arr) {
int positiveNum =0 , negativeNum=0 , zeros =0; int size = arr.Count(); foreach(int x in arr ){ if(x >0 ){ positiveNum++; } else if (x<0){ negativeNum ++; } else{ zeros++; } } Console.WriteLine((positiveNum/(double)size).ToString("F6")); Console.WriteLine((negativeNum/(double)size).ToString("F6")); Console.WriteLine((zeros/(double)size).ToString("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 →
in c# public static void plusMinus(List arr) {