Last active
July 22, 2021 08:05
-
-
Save mohdjishin/908a08d6c6d3a1af277eecf9c34193de to your computer and use it in GitHub Desktop.
This is a demonstration of dynamic printing in Golang
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" | |
func main() { | |
var i int = 1 | |
var t bool = true | |
var a int = 1 | |
for t { | |
i = i + 1 | |
fmt.Print("\rHello World : ", i) | |
if i == 1000000 || i%1000000 == 0 { | |
fmt.Println("\ndo you wanna stop this(1 for yes 0 for No): ") | |
fmt.Scanln(&a) | |
if a == 1 { | |
t = false | |
} else { | |
t = true | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment