-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsum.go
62 lines (45 loc) · 1.01 KB
/
sum.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"fmt"
)
// func Err(){
// return "Sorry Try again"
// main()
// }
// func Substract (){
//
// }
func WannaPlayAgain(){
var getAns string
fmt.Println("Hello , Wanna Play Again with Us (Yes/No)")
fmt.Scan(&getAns)
if (getAns == "yes")||(getAns == "y"){
fmt.Println("Nice to have you Again")
Sum()
}else {
fmt.Println("It seems you dont wanna play \nBye!!")
}
}
func WannaPlay(){
var getAns string
fmt.Println("Hello We are going to make game \n Do you want to get the number \n(yes or no) ")
fmt.Scan(&getAns)
if (getAns == "yes")||(getAns == "y"){
fmt.Println("Nice to have you")
Sum()
}else {
fmt.Println("It seems you dont wanna play")
}
}
func Sum(){
var one,two int
fmt.Println("type two number")
fmt.Scan(&one,&two)
result := one + two
fmt.Println("Your Result is :",result,"total")
WannaPlayAgain()
}
func main(){
// var one, two int
WannaPlay()
}