Bilişim Teknolojilerinin Temelleri dersi sınav soruları (Soru 1)
Klavyeden girilen iki sayı arasındaki tek sayıların ve çift sayılarının toplamını bulup sonucu ilgili labellere yazdıran programın vb kodlarını yazınız?

[Code=’VB.NET’]Private Sub Command1_Click()
Dim toplam, tektoplam, cifttoplam As Single
Dim a, altsinir, ustsinir As Integer
altsinir = Val(Text1.Text)
ustsinir = Val(Text2.Text)
For a = altsinir To ustsinir
If a Mod 2 = 1 Then tektoplam = tektoplam + a
If a Mod 2 = 0 Then cifttoplam = cifttoplam + a
toplam = toplam + a
Next
Label6.Caption = tektoplam
Label7.Caption = cifttoplam
Label8.Caption = toplam
End Sub[/Code]