Monday, 12 May 2014

Hipotenusa VBNET

    Sub Main()
start:
        Dim x As Integer = Nothing
        Dim y As Integer = Nothing
        Dim r As Double = Nothing
        Console.WriteLine("SELAMAT DATANG DI PROGRAM MENCARI NILAI HIPOTENUSA")
        Console.WriteLine("Masukkan nilai x anda: ")
        x = Console.ReadLine()
        Console.WriteLine("Masukkan nilai y anda: ")
        y = Console.ReadLine()
        r = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2))
        Console.WriteLine("Nilai hipotenusa kamu adalah: " & r)
        Console.WriteLine("Lagi?(y/n)")
        Dim lagi = Console.ReadLine()
        If lagi = "y" Then
            GoTo start
        End If
        Console.WriteLine("BYEEEEE!!!!! SIMPLE BUKAN??")
        Console.ReadLine()
    End Sub

No comments:

Post a Comment