Visual Basic üç sayıdan en büyüğü ve en küçüğünü bulan program - Bilişim Konuları

Visual Basic üç sayıdan en büyüğü ve en küçüğünü bulan program

Visual Basic üç sayıdan en büyüğü ve en küçüğünü bulan program. Ekranda bulunan üç tane textboxa herhangi üç adet sayı giriliyor. Hesapla butonuna tıklanınca altta bulunan iki adet textboxa en büyük sayı ve en küçük sayı ayrı ayrı yazdırılıyor. Kolay gelsin.

Program Kodları:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Val(TextBox1.Text) > Val(TextBox2.Text) And Val(TextBox1.Text) > Val(TextBox3.Text) Then
            TextBox4.Text = TextBox1.Text
        End If
        If Val(TextBox2.Text) > Val(TextBox1.Text) And Val(TextBox2.Text) > Val(TextBox3.Text) Then
            TextBox4.Text = TextBox2.Text
        End If
        If Val(TextBox3.Text) > Val(TextBox1.Text) And Val(TextBox3.Text) > Val(TextBox2.Text) Then
            TextBox4.Text = TextBox3.Text
        End If
        If Val(TextBox1.Text) < Val(TextBox2.Text) And Val(TextBox1.Text) < Val(TextBox3.Text) Then
            TextBox5.Text = TextBox1.Text
        End If
        If Val(TextBox2.Text) < Val(TextBox1.Text) And Val(TextBox2.Text) < Val(TextBox3.Text) Then
            TextBox5.Text = TextBox2.Text
        End If
        If Val(TextBox3.Text) < Val(TextBox1.Text) And Val(TextBox3.Text) < Val(TextBox2.Text) Then
            TextBox5.Text = TextBox3.Text
        End If
    End Sub
End Class

Ekran Görüntüsü

Bu Yazıya Tepkin Nedir?
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Yorum Yap