Section3
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
const secondsInHour = 3600
|
const secondsInHour = 3600
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
fmt.Println("Hello Go World!!")
|
fmt.Println("Hello Go World!!")
|
||||||
distance := 60.8 //distance in km
|
distance := 60.8
|
||||||
fmt.Printf("the distance in miles is %f \n", distance * 0.621)
|
fmt.Printf("the distance in miles is %f \n", distance * 0.621)
|
||||||
}
|
}
|
||||||
BIN
Section3/ex2
Executable file
BIN
Section3/ex2
Executable file
Binary file not shown.
9
Section3/exercice1.go
Normal file
9
Section3/exercice1.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
a := 1
|
||||||
|
b := 2
|
||||||
|
fmt.Println(a, b)
|
||||||
|
}
|
||||||
10
Section3/exercice2.go
Normal file
10
Section3/exercice2.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
a := 1
|
||||||
|
b := 2
|
||||||
|
c := a + b
|
||||||
|
fmt.Println("The addition of ", a, " and ", b, " is ", c)
|
||||||
|
}
|
||||||
13
Section3/exercice6.go
Normal file
13
Section3/exercice6.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
SayHello()
|
||||||
|
}
|
||||||
|
func SayHello() {
|
||||||
|
fmt.Println("Hello package v1.0.0!")
|
||||||
|
|
||||||
|
var x int = 10
|
||||||
|
_ = x
|
||||||
|
}
|
||||||
BIN
Section3/my_first_go_app
Executable file
BIN
Section3/my_first_go_app
Executable file
Binary file not shown.
BIN
Section3/my_go_program_mac
Executable file
BIN
Section3/my_go_program_mac
Executable file
Binary file not shown.
Reference in New Issue
Block a user