forked from MJK618/100HoursOfGo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhour14.go
More file actions
73 lines (54 loc) · 856 Bytes
/
Copy pathhour14.go
File metadata and controls
73 lines (54 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package _100HoursOfGo
import "fmt"
const (
n = 10
o = "an untyped string"
p = 45.20
)
const (
q int = 100
r string = "a typed string"
s float64 = 4.2069
)
const (
currentYear = iota + 2021
nextYear
nextNextYear
nextNextNextYear
)
func main() {
a := 10
b := 20
g := a==b
h := a <= b
i:= a >= b
j:= a != b
k:= a < b
l:= a > b
fmt.Println(g)
fmt.Println(h)
fmt.Println(i)
fmt.Println(j)
fmt.Println(k)
fmt.Println(l)
m := 618
fmt.Printf("%d\n%b\n%x",m,m,m)
fmt.Println(n)
fmt.Println(o)
fmt.Println(p)
fmt.Println(q)
fmt.Println(r)
fmt.Println(s)
t := 420
fmt.Printf("%d\n%b\n%x\n",t,t,t)
u := t << 1
fmt.Printf("%d\n%b\n%x",u,u,u)
v := `"So this is
a
raw string literal"`
fmt.Println(v)
fmt.Println(currentYear)
fmt.Println(nextYear)
fmt.Println(nextNextYear)
fmt.Println(nextNextNextYear)
}