Skip to content

Commit 4f4b150

Browse files
committed
Ders17
1 parent 9b898e6 commit 4f4b150

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

17_control_comparison/main.go

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Comparison operators
2+
// == Equal != Not equal
3+
// < Less than > Greater than
4+
// <= Less than or equal >= Greater than or equal
5+
6+
// Logical Operators
7+
// && conditional AND p && q is "if p then q else false"
8+
// || conditional OR p || q is "if p then true else q"
9+
// ! NOT !p is "not p"
10+
11+
package main
12+
13+
import "fmt"
14+
15+
func main() {
16+
17+
/* x, y := 3, "b" // 98
18+
19+
fmt.Printf("%T, %v\n", x == y, x == y)
20+
fmt.Printf("%T, %v\n", x != y, x != y)
21+
fmt.Printf("%T, %v\n", x < y, x < y)
22+
fmt.Printf("%T, %v\n", x > y, x > y)
23+
fmt.Printf("%T, %v\n", x >= y, x >= y)
24+
fmt.Printf("%T, %v\n", x <= y, x <= y) */
25+
26+
//x, y := 15, 20
27+
28+
//set1 := (x == y) // false
29+
//set2 := (x > y) // false
30+
31+
set3 := false
32+
33+
/* fmt.Printf("%T, %v\n", set1, set1)
34+
fmt.Printf("%T, %v\n", set2, set2) */
35+
36+
// fmt.Printf("%v\n", (set1 && set2)) // AND --> sadece 2 durum true --> true
37+
//fmt.Printf("%v\n", (set3 || set2)) // OR --> sadece 2 durum false --> false
38+
39+
fmt.Printf("%v\n", (!set3))
40+
41+
}

0 commit comments

Comments
 (0)