vb simple program
VB PROGRAM
MICROSOFT VISUAL BASIC
write a program to print the multiplication table-
Dim I, j As Integer
Private Sub command1_click()
For I = 1 To 10
For j = 1 To 10
p = I * j
Print I; "*"; j; "="; p,
Next j
Print
Next I
End Sub
Write a program to find the summation of undetermined number of
positive numbers such that the program will be stopped when we enter negative number-
Dim x, sum As Single
Private Sub command1_click()
sum = 0
x = Val(InputBox("enter x", "summation"))
Do While x >= 0
sum = sum + x
x = Val(InputBox("enter x", "summation "))
Loop
MsgBox (CStr(sum))
End Sub
Comments
Post a Comment