Pages

Selasa, 15 Maret 2011

Modul VB – Latihan Program Phitagoras

Soal Latihan VB

Buatlah program menghitung sisi miring (rumus Phitagoras)
Input : a, b
Output : c = Sqr(a^2 + b^2)
Modul VB - Program Rumus Phitagoras
Modul VB - Program Rumus Phitagoras

Jawaban

Pengkodean:
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Sqr(a ^ 2 + b ^ 2)
Text3.Text = c
End Sub
Private Sub Command2_Click()
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Print Friendly and PDF

Artikel Terkait:

0 komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...