aaa123 Warga Lama
Jumlah posting : 63 Join date : 2011-04-23 Age : 25 Lokasi : Di Hatimu
| Subject: Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console Sun Aug 07, 2011 8:02 pm | |
| coding ini adalah untuk memunculkan bilangan prima dai 1 sampai 100 [You must be registered and logged in to see this image.] - Code:
-
Imports System.Console Module Module1
Sub Main() Dim i As Integer, j As Integer Dim prima As Boolean
For i = 1 To 100 prima = False If (i = 2) Then prima = True Else For j = 2 To (i - 1) If (i Mod j = 0) Then prima = False Exit For Else prima = True End If Next j End If
If prima = True Then Write(" " & i) End If Next i Read()
End Sub
End Module Credit: Me kalo gk ngerti komen aja disini | |
|