Giter Club home page Giter Club logo

Comments (13)

M3L1M avatar M3L1M commented on August 22, 2024 1

s := "Gabriel"

if s == "Gabriel" {
	fmt.Println("Que nome legal")
} else if s == "Marquinhos" {
	fmt.Println("Que nome meia boca")
} else {
	fmt.Println("Blz, pare de tentar, o seu nome não é legal")
}

from aprendago.

diegoparra avatar diegoparra commented on August 22, 2024

https://play.golang.org/p/4xGvuraDNTC

from aprendago.

thiagoalgo avatar thiagoalgo commented on August 22, 2024

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

from aprendago.

viniciussanchez avatar viniciussanchez commented on August 22, 2024

https://play.golang.org/p/-EDl6Cml38n

from aprendago.

tomxdev avatar tomxdev commented on August 22, 2024
package main

import "fmt"

func main() {
	isValid := 2
	if isValid == 0 {
		fmt.Println("status 0")
	}else if isValid == 1 {
		fmt.Println("status 1")
	}else {
		fmt.Println("status inválido")
	}
}

from aprendago.

an4kein avatar an4kein commented on August 22, 2024
  • Utilizando a solução anterior, adicione as opções else if e else.

https://play.golang.org/p/-J0H_0SRrMu

from aprendago.

ygorsimoes avatar ygorsimoes commented on August 22, 2024

from aprendago.

JPauloMoura avatar JPauloMoura commented on August 22, 2024
package main

//Utilizando a solução anterior, adicione as opções else if e else.
import "fmt"

func main() {
	if eDomingo := true; eDomingo {
		fmt.Print("Bom dia! Hoje é Domingo dia de descansar!")
	} else {
		fmt.Print("Bom dia! Tenho que trabalhar duro hoje!")
	}
}

Resolução do Exercício

from aprendago.

Lucasmirandar avatar Lucasmirandar commented on August 22, 2024

package main

import "fmt"

func main() {
x := 10
if x < 10 {
fmt.Println("X < 10")
} else if x == 10 {
fmt.Println("X = 10")
} else {
fmt.Println("X > 10")
}
}

from aprendago.

CarlosSMA avatar CarlosSMA commented on August 22, 2024
package main

import (
	"fmt"
)

func main() {
	numero1 := 2
	numero2 := 3
	numero3 := 4

	for i := 1; i <= 10; i++ {
		if i%numero1 == 0 {
			fmt.Println("Número", i, " é divisível por 2")
		}
		if i%numero2 == 0 {
			fmt.Println("Número", i, " é divisível por 3")
		}
		if i%numero3 == 0 {
			fmt.Println("Número", i, " é divisível por 4")
		}

		if !(i%numero1 == 0) && !(i%numero2 == 0) && !(i%numero3 == 0) {
			fmt.Println("Número", i, " não é divisível por 2, 3 ou 4")
		} else if i%numero1 == 0 {
			fmt.Println("Número", i, " é divisível por 2 (2)")
		} else {
			fmt.Println("Numéro", i, " é divisível por 3 ou 4")
		}
	}
}

Saída

Número 1  não é divisível por 2, 3 ou 4
Número 2  é divisível por 2
Número 2  é divisível por 2 (2)
Número 3  é divisível por 3
Numéro 3  é divisível por 3 ou 4
[...]

from aprendago.

CaueFarias avatar CaueFarias commented on August 22, 2024

https://go.dev/play/p/B2tye_aStOT

from aprendago.

wfrsilva avatar wfrsilva commented on August 22, 2024

https://go.dev/play/p/2j1rnyTzcpS

image

from aprendago.

adelsonsljunior avatar adelsonsljunior commented on August 22, 2024
package main

import (
	"fmt"
)

func main() {

	numero := 3

	if numero == 1 {
		fmt.Println("É 1!")
	} else if numero == 2 {
		fmt.Println("É 2!")
	} else {
		fmt.Println("É um número aleatório!")
	}

}

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.