Giter Club home page Giter Club logo

Comments (6)

dsmello avatar dsmello commented on August 22, 2024

https://play.golang.org/p/eNyWkEiRf4n

from aprendago.

diegoparra avatar diegoparra commented on August 22, 2024

fui no simples tbm: https://play.golang.org/p/LdHBH5qIZ5J

from aprendago.

an4kein avatar an4kein commented on August 22, 2024

https://play.golang.org/p/jygLUCmMqd_s

package main

import "fmt"

/* - Utilize a declaração defer de maneira que demonstre que sua execução
só ocorre ao final do contexto ao qual ela pertence.
*/

func malig(x []int) int {
	soma := 0
	for _, i := range x {
		soma += i
	}
	return soma
}

func main() {
	defer fmt.Println("isso vem depois pq eh um defer")
	lista := []int{10, 10, 10, 10, 10}
	fmt.Println(malig(lista))
}

Output

50
isso vem depois pq eh um defer

Program exited.

from aprendago.

alansantosmg avatar alansantosmg commented on August 22, 2024

my solution:

package main

import "fmt"

func main() {

	a := 10
	b := 50

	x := a + b
	defer fmt.Print(x)
	fmt.Print("O resultado da soma de A + B é: ")

}

from aprendago.

gomesmatheus avatar gomesmatheus commented on August 22, 2024
package main

import "fmt"

func main() {
	defer fmt.Println("Acabou a contagem, obrigado a todos os envolvidos")

	x := 10
	fmt.Println("Vamos contar até", x, "!")
	for i := 1; i <= 10; i++ {
		fmt.Println(i)
	}
}

from aprendago.

wfrsilva avatar wfrsilva commented on August 22, 2024

Cap. 13 – Exercícios: Nível #6 – 3
https://go.dev/play/p/p8XYuOiQeeU

image

from aprendago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.