diff --git a/ch1/booleans.go b/ch1/booleans.go new file mode 100644 index 0000000..4379071 --- /dev/null +++ b/ch1/booleans.go @@ -0,0 +1,13 @@ +package main + +import "fmt" + +func main() { + fmt.Println(true && true) + fmt.Println(true && false) + fmt.Println(true || true) + fmt.Println(true || false) + fmt.Println(!true) + + fmt.Println((true && false) || (false && true) || !(false && false)) +} diff --git a/ch1/main.go b/ch1/main.go new file mode 100644 index 0000000..91e7378 --- /dev/null +++ b/ch1/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello World") +} diff --git a/ch1/numbers.go b/ch1/numbers.go new file mode 100644 index 0000000..72c9988 --- /dev/null +++ b/ch1/numbers.go @@ -0,0 +1,8 @@ +package main + +import "fmt" + +func main() { + fmt.Println("1 + 1 = ", 1 + 1) + fmt.Println("1.0 + 1.0 = ", 1.0 + 1.0) +} diff --git a/ch1/strings.go b/ch1/strings.go new file mode 100644 index 0000000..11f1704 --- /dev/null +++ b/ch1/strings.go @@ -0,0 +1,17 @@ +package main + +import "fmt" + +func main() { + fmt.Println(len("Ashwin Hegde")) + fmt.Println("Ashwin Hegde"[1]) + fmt.Println("Ashwin " + "Hegde") + +// fmt.Println("Ashwin" + 45) +// fmt.Println("45" + 45) + +// fmt.Println(5 + 5 + 5) +// fmt.Println("5" + 5 + 5) +// fmt.Println(5 + "5" + 5) +// fmt.Println(5 + 5 + "5") +}