Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 22 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /