Answers for "hackerrank golang plus minus"

0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021
0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021
0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021
0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021
0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021
0

hackerrank golang plus minus

func plusMinus(arr []int32) {
    var positive, negative, zero, total float64
    total = float64(len(arr))
    
    for _, v := range arr {
        if v > 0 {
            positive++
        } else if  v < 0  {
            negative++
        } else {
            zero++
        }
    }
    
    fmt.Printf("%v\n", positive / total)
    fmt.Printf("%v\n", negative/ total)
    fmt.Printf("%v\n", zero / total)
}
Posted by: Guest on October-18-2021

Browse Popular Code Answers by Language