Coding:
Imports System.Console
Module Module1
Sub Main()
Dim bil, i, j, y As Integer
' Dim hasil As Integer
Write("Masukan Angka : ")
bil = ReadLine()
WriteLine("")
If bil > 0 And bil <= bil Then
For i = bil To 1 Step -1
For j = 1 To i Step 1
Write(" ")
Next j
For j = 1 To bil Step 1
y = 2 * j - 1
Write("*")
Next j
WriteLine("")
Next i
End If
ReadLine()
End Sub
End Module
Module Module1
Sub Main()
Dim bil, i, j, y As Integer
' Dim hasil As Integer
Write("Masukan Angka : ")
bil = ReadLine()
WriteLine("")
If bil > 0 And bil <= bil Then
For i = bil To 1 Step -1
For j = 1 To i Step 1
Write(" ")
Next j
For j = 1 To bil Step 1
y = 2 * j - 1
Write("*")
Next j
WriteLine("")
Next i
End If
ReadLine()
End Sub
End Module
Sekarang berdasarkan reques dari KHézié LøvìñG'ü Ælwåys yang menginginkan kalau inputannya harus seperti ini:
Codingnya:
Imports System.Console
Module Module1
Sub Main()
Dim bil, i, j, y As Integer
' Dim hasil As Integer
Write("Masukan Angka : ")
bil = ReadLine()
WriteLine("")
If bil > 0 And bil <= bil Then
For i = bil To 1 Step -1
For j = 1 To i Step 1
Write(" ")
Next j
For j = 1 To bil Step 1
y = 2 * j - 1
Write(y)
Next j
WriteLine("")
Next i
End If
ReadLine()
End Sub
End Module
Module Module1
Sub Main()
Dim bil, i, j, y As Integer
' Dim hasil As Integer
Write("Masukan Angka : ")
bil = ReadLine()
WriteLine("")
If bil > 0 And bil <= bil Then
For i = bil To 1 Step -1
For j = 1 To i Step 1
Write(" ")
Next j
For j = 1 To bil Step 1
y = 2 * j - 1
Write(y)
Next j
WriteLine("")
Next i
End If
ReadLine()
End Sub
End Module
Tidak ada komentar:
Posting Komentar