|
| 1 | +/* package main |
| 2 | +
|
| 3 | +import "merhaba" |
| 4 | +
|
| 5 | +func main() { |
| 6 | +
|
| 7 | + merhaba.Hola() |
| 8 | + merhaba.Hello() |
| 9 | + merhaba.Merhaba() |
| 10 | +
|
| 11 | +} */ |
| 12 | + |
| 13 | +/* package main |
| 14 | +
|
| 15 | +import ( |
| 16 | + "bufio" |
| 17 | + "fmt" |
| 18 | + "os" |
| 19 | + "strconv" |
| 20 | + "strings" |
| 21 | +) |
| 22 | +
|
| 23 | +func main() { |
| 24 | +
|
| 25 | + fmt.Print("Lütfen Celcius dereceyi giriniz: ") |
| 26 | + celcius, err := getCelcius() |
| 27 | + if err != nil { |
| 28 | + fmt.Println(err) |
| 29 | + } |
| 30 | +
|
| 31 | + fahrenheit := (celcius * 9 / 5) + 32 |
| 32 | +
|
| 33 | + fmt.Println(celcius, "Celcius derecesi ", fahrenheit, "Fahrenheit derecesine eşittir.") |
| 34 | +
|
| 35 | +} |
| 36 | +
|
| 37 | +func getCelcius() (float64, error) { |
| 38 | + reader := bufio.NewReader(os.Stdin) |
| 39 | + input, err := reader.ReadString('\n') |
| 40 | + if err != nil { |
| 41 | + fmt.Println(err) |
| 42 | + } |
| 43 | +
|
| 44 | + input = strings.TrimSpace(input) |
| 45 | + num, err := strconv.ParseFloat(input, 64) |
| 46 | + if err != nil { |
| 47 | + fmt.Println(err) |
| 48 | + } |
| 49 | +
|
| 50 | + return num, nil |
| 51 | +} */ |
| 52 | + |
| 53 | +/* package main |
| 54 | +
|
| 55 | +import ( |
| 56 | + "bufio" |
| 57 | + "fmt" |
| 58 | + "os" |
| 59 | + "strconv" |
| 60 | + "strings" |
| 61 | +) |
| 62 | +
|
| 63 | +func main() { |
| 64 | +
|
| 65 | + fmt.Print("Lütfen Celcius dereceyi giriniz: ") |
| 66 | + celcius, err := getCelcius() |
| 67 | + if err != nil { |
| 68 | + fmt.Println(err) |
| 69 | + } |
| 70 | +
|
| 71 | + kelvin := celcius + 273 |
| 72 | +
|
| 73 | + fmt.Println(celcius, "Celcius derecesi ", kelvin, "Kelvin derecesine eşittir.") |
| 74 | +
|
| 75 | +} |
| 76 | +
|
| 77 | +func getCelcius() (float64, error) { |
| 78 | + reader := bufio.NewReader(os.Stdin) |
| 79 | + input, err := reader.ReadString('\n') |
| 80 | + if err != nil { |
| 81 | + fmt.Println(err) |
| 82 | + } |
| 83 | +
|
| 84 | + input = strings.TrimSpace(input) |
| 85 | + num, err := strconv.ParseFloat(input, 64) |
| 86 | + if err != nil { |
| 87 | + fmt.Println(err) |
| 88 | + } |
| 89 | +
|
| 90 | + return num, nil |
| 91 | +} */ |
| 92 | + |
| 93 | +/* package main |
| 94 | +
|
| 95 | +import ( |
| 96 | + "fmt" |
| 97 | + "getcelcius" |
| 98 | +) |
| 99 | +
|
| 100 | +func main() { |
| 101 | +
|
| 102 | + fmt.Print("Lütfen Celcius dereceyi giriniz: ") |
| 103 | + celcius, err := getcelcius.GetCelcius() |
| 104 | + if err != nil { |
| 105 | + fmt.Println(err) |
| 106 | + } |
| 107 | +
|
| 108 | + kelvin := celcius + 273 |
| 109 | +
|
| 110 | + fmt.Println(celcius, "Celcius derecesi ", kelvin, "Kelvin derecesine eşittir.") |
| 111 | +
|
| 112 | +} */ |
| 113 | + |
| 114 | +package main |
| 115 | + |
| 116 | +import ( |
| 117 | + "fmt" |
| 118 | + "getcelcius" |
| 119 | +) |
| 120 | + |
| 121 | +func main() { |
| 122 | + |
| 123 | + fmt.Print("Lütfen Celcius dereceyi giriniz: ") |
| 124 | + celcius, err := getcelcius.GetCelcius() |
| 125 | + if err != nil { |
| 126 | + fmt.Println(err) |
| 127 | + } |
| 128 | + |
| 129 | + fahrenheit := (celcius * 9 / 5) + 32 |
| 130 | + |
| 131 | + fmt.Println(celcius, "Celcius derecesi ", fahrenheit, "Fahrenheit derecesine eşittir.") |
| 132 | + |
| 133 | +} |
0 commit comments