Skip to content

Instantly share code, notes, and snippets.

@khaidir
Created August 12, 2022 23:04
Show Gist options
  • Save khaidir/7b788998e97eb16322de82faa6d63b72 to your computer and use it in GitHub Desktop.
Save khaidir/7b788998e97eb16322de82faa6d63b72 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
var one int
fmt.Println("Inputan deret pertama:")
fmt.Scan(&one)
var second int
fmt.Println("Inputan deret pertama:")
fmt.Scan(&second)
var batas int
fmt.Println("Nilai x:")
fmt.Scan(&batas)
s := second - one
for i := 1; i <= batas; i++ {
fmt.Println(one)
one = one + s
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment