Computer Science, asked by rashika194, 5 months ago

write VB program to accept the number to check whether it is in the range of 50-100

Answers

Answered by Anonymous
2

Answer:

Private Sub cmdClear_Click()

Text1.Text = “”

Text1.SetFocus

End Sub

Private Sub cmdExit_Click()

Unload Me

End Sub

Private Sub cmdfind_Click()

Dim n As Integer

Dim s As Integer

s = 0

n = Val(Text1.Text)

For i = 1 To n – 1

If n Mod i = 0 Then

s = s + i

End If

Next

If n = s Then

MsgBox “Perfect Number”, vbInformation, “Perfect”

Else

MsgBox “Not Perfect Number”, vbInformation, “Perfect”

End If

End Sub

Private Sub Form_Activate()

Text1.SetFocus

End Sub

Explanation:

Similar questions