Skip to content

Commit

Permalink
soru1 icin cozum eklendi
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokcekuler committed Mar 24, 2019
1 parent 4141b68 commit 2ab190a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions calisma03/soru1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package main

import "fmt"

func main() {
var A [10]int
var B [10]int
var C [10]int
for i := 0; i <= 9; i++ {
fmt.Println("Bir sayı giriniz")
fmt.Scanf("%d", &A[i])

}
for m := 0; m < len(A); m++ {
for n := 0; n < len(A)-1-m; n++ {
if A[n] > A[n+1] {
A[n], A[n+1] = A[n+1], A[n]
}
}
}

fmt.Println(A)

for j := 0; j <= 9; j++ {
fmt.Println("Bir sayı giriniz")
fmt.Scanf("%d", &B[j])

}

for k := 0; k < len(B); k++ {
for l := 0; l < len(B)-1-k; l++ {
if B[l] < B[l+1] {
B[l], B[l+1] = B[l+1], B[l]
}
}
}

fmt.Println(B)
for p := 0; p <= 9; p++ {

C[p] = A[p] + B[p]

}
fmt.Println(C)

}

0 comments on commit 2ab190a

Please sign in to comment.