Program Vb.Net : Membuat Deret Bilangan 2 1 4 3 6 5 dengan Console
Request Dari KHézié LøvìñG'ü Ælwåys
Input n : 6
hasil : 2 1 4 3 6 5
Coding:
Input n : 6
hasil : 2 1 4 3 6 5
Coding:
Imports System.Console
Module Module1
Sub Main()
Dim d, i, y As Integer
Dim hasil As Integer
Write("Masukan Banyaknya bilangan genap : ")
i = ReadLine()
For d = 1 To i Step 1
If d Mod 2 = 0 Then
y = 2 * d - (d + 1)
Else
y = 2 * d - (d - 1)
End If
hasil = hasil + y
Write(y)
Next d
WriteLine("")
Write("total= ")
Write(hasil)
ReadLine()
End Sub
End Module
Module Module1
Sub Main()
Dim d, i, y As Integer
Dim hasil As Integer
Write("Masukan Banyaknya bilangan genap : ")
i = ReadLine()
For d = 1 To i Step 1
If d Mod 2 = 0 Then
y = 2 * d - (d + 1)
Else
y = 2 * d - (d - 1)
End If
hasil = hasil + y
Write(y)
Next d
WriteLine("")
Write("total= ")
Write(hasil)
ReadLine()
End Sub
End Module
Sob bisa mntak tolong sob??? Tlong bikinin Console aplication deret bilangan 1,10,100...dst smpai 8 suku. Mohon bantuannya
BalasHapus@redho ,, coba setiap nilai dikali 10
BalasHapus