From dda560aaa8f7328f60f5b8cb2c4ff3b9d647b877 Mon Sep 17 00:00:00 2001 From: sebastian Date: Fri, 6 Oct 2023 14:17:02 +0200 Subject: [PATCH] Section6.60 --- Section6/57.go | 10 +++++----- Section6/59.go | 12 ++++++++++++ Section6/60.go | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 Section6/59.go create mode 100644 Section6/60.go diff --git a/Section6/57.go b/Section6/57.go index 630294a..6b67a5c 100644 --- a/Section6/57.go +++ b/Section6/57.go @@ -11,9 +11,9 @@ func main() { } // INFINITE LOOP - sum := 0 - for { - sum++ - } - fmt.Println(sum) + /* sum := 0 + for { + sum++ + } + fmt.Println(sum) */ } diff --git a/Section6/59.go b/Section6/59.go new file mode 100644 index 0000000..9ae23ef --- /dev/null +++ b/Section6/59.go @@ -0,0 +1,12 @@ +package main + +import "fmt" + +func main() { + for i := 0; i < 10; i++ { + if i%2 != 0 { + continue + } + fmt.Println(i) + } +} diff --git a/Section6/60.go b/Section6/60.go new file mode 100644 index 0000000..cdb1e04 --- /dev/null +++ b/Section6/60.go @@ -0,0 +1,18 @@ +package main + +import "fmt" + +func main() { + count := 0 + + for i := 0; true; i++ { + if i%13 == 0 { + fmt.Printf("%d is divisible by 13 \n", i) + count++ + } + if count == 10 { + break + } + } + fmt.Println("Your 10 numbers divisible by 13") +}