IT quiz
All questions
Sign in
Sign up
JavaScript
HTML
CSS
PostgreSQL
PHP
Linux
Git
Docker
SCSS
TypeScript
SQL
Vue
DNS
Go
frontend (web)
Redis
backend
Gitlab
CI/CD
Vite
webpack
Node.js
HTTP
Python
Kotlin
Nuxt
Question #141
Author:
admin
tags:
Go
package main import "fmt" func main() { var a int var b bool fmt.Println(a, b) }
What will be printed?
nil nil
null null
0 false
0 true
0 0
Nothing
Answer
Show explanation
Variables declared without an explicit initial value are given their zero value.
The zero value is:
0
for numeric types,
false
for the boolean type, and
""
(the empty string) for strings.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question (Go)
Next question (Go)
→
Write new comment