even and odd numbers printed
This commit is contained in:
parent
fc6da850b8
commit
2f9219e18d
2 changed files with 19 additions and 0 deletions
15
goroutines/demo1.go
Normal file
15
goroutines/demo1.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package goroutines
|
||||
|
||||
import "fmt"
|
||||
|
||||
func EvenNumber() {
|
||||
for i := 0; i < 10; i+=2 {
|
||||
fmt.Println("Even Number : ", i)
|
||||
}
|
||||
}
|
||||
|
||||
func OddNumber() {
|
||||
for i := 1; i < 10; i+=2 {
|
||||
fmt.Println("Odd Number : ", i)
|
||||
}
|
||||
}
|
4
main.go
4
main.go
|
@ -6,6 +6,7 @@ import (
|
|||
"golesson/conditionals"
|
||||
"golesson/examplerange"
|
||||
"golesson/functions"
|
||||
"golesson/goroutines"
|
||||
"golesson/loops"
|
||||
"golesson/maps"
|
||||
"golesson/pointers"
|
||||
|
@ -55,4 +56,7 @@ func main() {
|
|||
fmt.Println("Numbers in Main", numbers[0])
|
||||
structs.Demo1()
|
||||
structs.Demo2()
|
||||
|
||||
goroutines.EvenNumber()
|
||||
goroutines.OddNumber()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue