File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt"
4+
5+ func main () {
6+ sonuc := 1
7+ var dizi [20 ]int
8+ dizi [0 ] = 1
9+ dizi [1 ] = 2
10+ for i := 2 ; i <= 19 ; i ++ {
11+ sonuc = sonuc + dizi [i - 1 ]
12+ dizi [i ] = sonuc + 1
13+
14+ }
15+
16+ fmt .Println (dizi )
17+
18+ }
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt"
4+
5+ func main () {
6+ var A [10 ]int
7+ var B [10 ]int
8+ var C [10 ]int
9+ for i := 0 ; i <= 9 ; i ++ {
10+ fmt .Println ("Bir sayı giriniz" )
11+ fmt .Scanf ("%d" , & A [i ])
12+
13+ }
14+ for m := 0 ; m < len (A ); m ++ {
15+ for n := 0 ; n < len (A )- 1 - m ; n ++ {
16+ if A [n ] > A [n + 1 ] {
17+ A [n ], A [n + 1 ] = A [n + 1 ], A [n ]
18+ }
19+ }
20+ }
21+
22+ fmt .Println (A )
23+
24+ for j := 0 ; j <= 9 ; j ++ {
25+ fmt .Println ("Bir sayı giriniz" )
26+ fmt .Scanf ("%d" , & B [j ])
27+
28+ }
29+
30+ for k := 0 ; k < len (B ); k ++ {
31+ for l := 0 ; l < len (B )- 1 - k ; l ++ {
32+ if B [l ] < B [l + 1 ] {
33+ B [l ], B [l + 1 ] = B [l + 1 ], B [l ]
34+ }
35+ }
36+ }
37+
38+ fmt .Println (B )
39+ for p := 0 ; p <= 9 ; p ++ {
40+
41+ C [p ] = A [p ] + B [p ]
42+
43+ }
44+ fmt .Println (C )
45+
46+ }
You can’t perform that action at this time.
0 commit comments