Quiz Go questions generated by ChatGT
package main
import "fmt"
func main() {
var x int = 15
var y float64 = 6.5
fmt.Println(float64(x) / y)
} |
Warning: Undefined array key "6401dc02834c7f2930044e42" in /var/www/templates/Quiz/questions-stats.html on line 30
Warning: Trying to access array offset on value of type null in /var/www/templates/Quiz/questions-stats.html on line 30
|
Warning: Undefined array key "6401dc02834c7f2930044e42" in /var/www/templates/Quiz/questions-stats.html on line 31
Warning: Trying to access array offset on value of type null in /var/www/templates/Quiz/questions-stats.html on line 31
|
package main
import "fmt"
func main() {
numbers := []int{1, 2, 3, 4, 5}
output := make(chan int)
go sum(numbers[:len(numbers)/2], output)
go sum(numbers[len(numbers)/2:], output)
sum1, sum2 := <-output, <-output
fmt.Println(sum1, sum2, sum1+sum2)
}
func sum(numbers []int, output chan int) {
sum := 0
for _, num := range numbers {
sum += num
}
output <- sum
} |
Warning: Undefined array key "6401dcc98aba2502d10f0564" in /var/www/templates/Quiz/questions-stats.html on line 30
Warning: Trying to access array offset on value of type null in /var/www/templates/Quiz/questions-stats.html on line 30
|
Warning: Undefined array key "6401dcc98aba2502d10f0564" in /var/www/templates/Quiz/questions-stats.html on line 31
Warning: Trying to access array offset on value of type null in /var/www/templates/Quiz/questions-stats.html on line 31
|