Created
July 13, 2019 07:58
-
-
Save gufranmirza/69f93c5b9941b0834ccdc32709e0060e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func numbers() { | |
for i := 1; i <= 5; i++ { | |
time.Sleep(250 * time.Millisecond) | |
fmt.Printf("%d ", i) | |
} | |
} | |
func alphabets() { | |
for i := 'a'; i <= 'e'; i++ { | |
time.Sleep(400 * time.Millisecond) | |
fmt.Printf("%c ", i) | |
} | |
} | |
func main() { | |
go numbers() | |
go alphabets() | |
time.Sleep(3000 * time.Millisecond) | |
fmt.Println("main terminated") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment