Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Desafio: Constantes | Introdução
Introdução ao Golang

bookDesafio: Constantes

Tarefa

Declarar e inicializar uma constante chamada myConst com o valor 17.

index.go

index.go

copy
1234567
package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
  1. Utilizar a palavra-chave const para constantes.
  2. Atribuir o valor diretamente na declaração.
  3. O nome deve ser myConst e o valor 17.
package main
import "fmt"

func main() {
    const myConst = 17
    fmt.Println(myConst) // Should output 17
}
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 11

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain why we use the `const` keyword here?

What happens if I try to change the value of `myConst` later in the code?

Can you show how to print the value of `myConst`?

Awesome!

Completion rate improved to 1.96

bookDesafio: Constantes

Deslize para mostrar o menu

Tarefa

Declarar e inicializar uma constante chamada myConst com o valor 17.

index.go

index.go

copy
1234567
package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
  1. Utilizar a palavra-chave const para constantes.
  2. Atribuir o valor diretamente na declaração.
  3. O nome deve ser myConst e o valor 17.
package main
import "fmt"

func main() {
    const myConst = 17
    fmt.Println(myConst) // Should output 17
}
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 11
some-alt