We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9f9822 commit 4e0e4c0Copy full SHA for 4e0e4c0
03_variables/04_exercise_solutions/ninja-level1.go
@@ -0,0 +1,43 @@
1
+package main
2
+
3
+import "fmt"
4
5
+var x int = 42
6
+var y string = "James Bond"
7
+var z bool = true
8
9
+type abk_int int
10
+type hotdog int
11
12
+var x_myint abk_int
13
14
+func main() {
15
16
+// exercise3()
17
+// exercise4()
18
+ exercise5()
19
20
+}
21
22
+func exercise3() {
23
24
+ s := fmt.Sprintf("%d %s %t",x,y,z)
25
+ fmt.Println(s)
26
27
28
+func exercise4() {
29
+ fmt.Printf("%d %T\n",x_myint,x_myint)
30
+ x_myint = abk_int(100)
31
32
33
34
35
+func exercise5() {
36
37
38
39
40
+ x = int(x_myint)
41
+ fmt.Printf("%d %T\n",x, x)
42
43
0 commit comments