-
Notifications
You must be signed in to change notification settings - Fork 0
/
bits.go
69 lines (54 loc) · 845 Bytes
/
bits.go
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
/*
Go-Pherit: A Learning Experience and personal SDK in Golang
Copyright (c) 2020 Rye Miller
https://darksociety.io
*/
package main
/*
Exercise: Declare variables (w/ bits)
1. Declare a few variables using the following types:
* int
* int8
* int16
* int32
* int64
* float32
* float64
* complex64
* complex128
* bool
* string
* rune
* byte
Output:
1. 0 0 0 0 0 0 0 (0+0i) (0+0i) false 0 0
Notes:
*/
import "fmt"
func main() {
// integer types
var i int
var i8 int8
var i16 int16
var i32 int32
var i64 int64
// float types
var f32 float32
var f64 float64
// complex types
var c64 complex64
var c128 complex128
// bool type
var b bool
// string types
var s string
var r rune
var by byte
fmt.Println(
i, i8, i16, i32, i64,
f32, f64,
c64, c128,
b, r, by,
)
fmt.Printf("%q\n", s)
}