Logical addition

Report a typo

You already know how a variadic function works with numbers. Let's write a code that contains a variadic parameter with a boolean type. You need to write a function that returns true if any of the arguments are true, and returns false if all of them are false. In the input, you get three logical values. You need to output the result that the function returns.

Sample Input 1:

false true false

Sample Output 1:

true
Write a program in Go
package main

import "fmt"

func main() {
var a, b, c bool
fmt.Scan(&a, ?, ?)

fmt.Println(Any(?))
}

func Any(values ?) ? {
for _, v := range values {
if v {
return ?
}
}

return false
}
___

Create a free account to access the full topic