Skip to content

Commit 6148146

Browse files
author
mostafa
committed
variable
1 parent 321c476 commit 6148146

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

variable/basic.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
// variable declare
7+
var age int = 21
8+
var name string = "kamal"
9+
fmt.Println("name is ", name, ", age = ", age)
10+
11+
// multiple variable
12+
var height, width int = 200, 300
13+
fmt.Println("height =", height, " and width = ", width)
14+
15+
// shorthand variable
16+
email := "hiremostafa@gmail.com"
17+
fmt.Println("email: ", email)
18+
19+
// constant
20+
const a int = 21
21+
fmt.Println(" const a = ", a)
22+
}

0 commit comments

Comments
 (0)