cmonhackns.n-stars.org
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Indonesian SWF Editor Community
 
HomeLatest imagesRegisterLog in
SELAMAT Datang Di Cmonhackns ===> Mulailah dari yang kecil... karena semua yang besar dulunya juga kecil..

 

 Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console

Go down 
AuthorMessage
aaa123
Warga Lama
Warga Lama
aaa123


Jumlah posting : 63
Join date : 2011-04-23
Age : 25
Lokasi : Di Hatimu

Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console Empty
PostSubject: Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console   Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console Icon_minitime1Sun 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
Back to top Go down
http://aaa123.cixx6.com
 
Deret Bilangan Prima 1 sampai 100 Dengan VB.net Console
Back to top 
Page 1 of 1
 Similar topics
-
» Key Avira Internet Security 2012 Sampai 19 09 2013
» [Video] Cara Buat Forum MyBb dari 0% sampai 100%
» [KRITIK]Error dalam cmonhackns.n-stars.org dan cmonhackns.net dari dulu sampai sekarang masih ada
» Aplikasi Run Dengan VB6
» Mohon dengan sangat

Permissions in this forum:You cannot reply to topics in this forum
cmonhackns.n-stars.org :: Computer Freakz :: All About Programming :: Visual Basic-
Jump to: