Home » » VB.Net Sayı Pozitif mi? Negatif mi?

VB.Net Sayı Pozitif mi? Negatif mi?

Kullanıcının girdiği sayının pozitif mi yoksa negatif mi olduğunu gösteren programı oluşturuyoruz…
poz
Bu programımızda sonucu msgboxda göstereceğimizden dolayı 1 button kullanacağız. Bu programı oluşturmak için buttonun içerisine şu kodlar yazılmalıdır;
Dim sayı As Integer
On Error Resume Next
sayı = InputBox("Sayıyı gir...", "pozitif negatif", 10, 35, 55)
If sayı > 0 Then MsgBox("SAYI POZİTİFTİR")
If sayı < 0 Then MsgBox("SAYI NEGATİFTİR")
If sayı = 0 Then MsgBox("SAYI SIFIRDIR")
NOT: Bu programda yazılmış olan kodlarda “On Error Resume Next” kodunu görüyoruz. Bu kod “Cancel” seçeneğine tıklanıldığında hata vermeyerek devam etmesini sağlayacaktır.
<!–[if gte mso 9]> Normal 0 21 false false false MicrosoftInternetExplorer4 <![endif]–><!–[if gte mso 9]> <![endif]–>
 
Support : Vaganzi
Copyright © 2013. Visual Studio Kod Bankası - All Rights Reserved
Powered By Vaganzi