Qtr No. 213, New Town Yehlanka Indore 454775
Consider the following code
//Assume all necessary imports are done
func main() {
filteredData := filter("apple", "banana", "cherry")
fmt.Println(filteredData)
}
func filter(data ...string) []string {
var result []string
for _, item := range data {
if len(item) > 5 {
result = append(result, item)
}
}
return result
}
Which of the following statements are true about the above program?
The program will output ["apple", "banana", "cherry"]
The program will output ["banana", "cherry"]
The program will output ["apple", "cherry"]
Compilation error: cannot pass multiple strings as variadic parameters
To get all Infosys Certified Go Programmer Exam questions Join Group https://bit.ly/infy_premium_group
We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.
Qtr No. 213, New Town Yehlanka Indore 454775
admin@prepflix.in