-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathname.go
45 lines (31 loc) · 1004 Bytes
/
name.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
package main
import "fmt"
func main() {
name := "MJ"
fmt.Println("Hello, All I'm", name)
a, b := 5, 7
fmt.Println("Sum:", a+b, "Mean Value:", (a+b)/2)
fmt.Printf("Your age is %d\n", 21)
fmt.Printf("x is %d, y is %f\n", 5, 9)
fmt.Printf("He says: \"Hello Go!\"\n")
figure := "Circle"
radius := 5
pi := 3.14159
_ = figure
fmt.Printf("Radius is %d\n", radius)
fmt.Printf("Radius is %+d\n", radius)
fmt.Printf("Pi constant is %f\n", pi)
fmt.Printf("The diameter of a %s with a Radius of %d is %f\n", figure, radius, float64(radius)*2*pi)
fmt.Printf("This is a %q\n", figure)
fmt.Printf("The diameter of a %v with a Radius of %v is %v\n", figure, radius, float64(radius)*2*pi)
fmt.Printf("figure is of type %T \n", figure)
fmt.Printf("radius is of type %T \n", radius)
fmt.Printf("pi is of type %T \n", pi)
closed := true
fmt.Printf("File closed: %t \n", closed)
fmt.Printf("%08b \n", 55)
fmt.Printf("%x \n", 100)
x := 3.4
y := 6.9
fmt.Printf("x * y = %.2f\n", x*y)
}