Soal Latihan VB
Buatlah program menghitung sisi miring (rumus Phitagoras)Input : a, b
Output : c = Sqr(a^2 + b^2)
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
0 komentar:
Posting Komentar