• + 0 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++;}}
    

    Console.WriteLine(positive /total); Console.WriteLine(negative /total); Console.WriteLine(zero / total);