Skip to content

Commit 4dfd52d

Browse files
authored
Merge pull request #2 from sselinkurt/master
switch-case
2 parents e2fea24 + bbf4bf1 commit 4dfd52d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

calisma02/odev2.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
7+
var sayi int
8+
9+
for {
10+
fmt.Println("1-7 arasinda bir sayi giriniz:\nCikmak icin 0 giriniz")
11+
fmt.Scanf("%d", &sayi)
12+
13+
if sayi == 0 {
14+
break
15+
}
16+
17+
switch sayi {
18+
case 1:
19+
fmt.Println("Pazartesi")
20+
case 2:
21+
fmt.Println("Sali")
22+
case 3:
23+
fmt.Println("Carsamba")
24+
case 4:
25+
fmt.Println("Persembe")
26+
case 5:
27+
fmt.Println("Cuma")
28+
case 6:
29+
fmt.Println("Cumartesi")
30+
case 7:
31+
fmt.Println("Pazar")
32+
default:
33+
fmt.Println("--Gecersiz bir sayi girdiniz.--")
34+
}
35+
}
36+
37+
}

0 commit comments

Comments
 (0)