Laman

Sabtu, 05 Juli 2014

Deret bilangan penjumlahan angka genap Pada VB.NET 2005 Console Application

Deret bilangan penjumlahan angka genap Pada VB.NET 2005 Console Application :
Imports System.Console
Module Module1

    Sub Main()
        Dim q, i, b, j As Integer
        Write(" masukan banyaknya deret  : ")
        q = ReadLine()
        For i = 1 To q
            b = i * 2
            j = j + b
            If i = q Then
                Write(b & "=")
            Else
                Write(b & "+")
            End If
        Next
        WriteLine(j)
        ReadLine()
    End Sub

Deret Bilangan terbalik Pada VB.NET 2005 Console Application

Deret Bilangan terbalik Pada VB.NET 2005 Console Application :

Imports System.Console
Module Module1

    Sub Main()
        Dim bil As Integer
        For bil = 10 To 1 Step -1
            Write(bil & " ")
        Next
        ReadLine()
    End Sub

If (Condition) Then - 3 kondisi Pada VB.NET 2005 Console Application

If (Condition) Then - 3 kondisi Pada VB.NET 2005 Console Application :

Imports system.Console
Module module1
    Sub main()
        Dim nama, ket, mk As String
        Dim nilai As Integer

If (condition) then-bilangan terkecil Pada VB.NET 2005 Console Application

If (condition) then-bilangan terkecil Pada VB.NET 2005 Console Application :

Imports System.Console
Module Module1

    Sub Main()
        Dim Bil1, Bil2, bil As Double
        Write("MASUKAN BIL 1 : ")
        Bil1 = ReadLine()
        Write("MASUKAN BIL 2: ")
        Bil2 = ReadLine()
        If Bil1 > Bil2 Then
            bil = Bil2
        Else
            bil = Bil1
        End If
        WriteLine("BILANGAN TERKECILNYA ADALAH: " & bil)
        ReadLine()
    End Sub

End Module

Deret Angka Ke bawah / Vertical Pada VB.NET 2005 Console Application

Deret Angka Ke bawah Pada / Vertical VB.NET 2005 Console Application :

Imports System.Console
Module Module1

    Sub Main()
        Dim x = 1
20:     WriteLine(x)
        If x = 5 Then GoTo 40
        x = x + 1
        GoTo 20
40:     ReadLine()
        End
    End Sub

End Module

Jumat, 04 Juli 2014

Logika (for next goto step) Pada VB.NET 2005 Console Application

Logika (for next goto step) Pada VB.NET 2005 Console Application :
Imports System.Console
Module Module1

    Sub Main()
        Dim i As Integer
        For i = 10 To 1 Step -2
            If i = 5 Then GoTo 100
            Write("PUSING ")
        Next i
100:
        ReadLine()
    End Sub

End Module

Deret Angka Pada VB.NET 2005 Console Application

Deret Angka  Pada VB.NET 2005 Console Application
Imports System.Console
Module Module1

    Sub Main()
        Dim i As Integer
        For i = 2 To 10
            Write(i - 2)
        Next i
        ReadLine()
    End Sub

End Module

Operasi Bilangan Pada VB.NET 2005 Console Application

Operasi Penjumlahan,perkalian,pengurangan dan pembagian Pada VB.NET 2005 Console Application :
Imports System.Console
Module Module1

Logika GoTo2 Pada Vb.net 2005 Console Application

Logika GoTo2 Pada Vb.net 2005 Console Application :
Imports System.Console
Module Module1

    Sub Main()
        Dim i, j, k As Integer
        Clear()
        Write("SAYA")
        GoTo 50
        Write("SEDANG")
50:     For i = 1 To 3
            j = j + i
            If i = 1 Then GoTo 100
            Write("LAGI")
            k = i + j
        Next i
100:    Write(i + j + k)
        Write(k)
        ReadLine()
        End
    End Sub

End Module

Logika Go to 1 Pada VB.NET 2005 Console Application

Logika GoTo1 Pada Vb.net 2005 Console Application :

Imports System.Console
Module Module1

    Sub Main()
        Dim i As Integer
        For i = 1 To 10 Step 4
            If i >= 8 Then GoTo 100
            Write("Kamu ")
        Next i
100:
        Write("Kesini")
        ReadLine()
    End Sub

End Module