Question Answer
1.Program to find Largest among three numbers using Inputbox and Msbbox?
Complete Source Code
Private Sub Form_Load()
Largest
End Sub
Public Sub Largest()
Dim A As Integer
Dim B As Integer
Dim C As Integer
A = Val(InputBox("Enter First No :"))
B = Val(InputBox("Enter Second No :"))
C = Val(InputBox("Enter Third No :"))
If (A > B) Then
If (MsgBox("The large number is " & A & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
If (B > C) Then
If (MsgBox(" The large number is " & B & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
If (C > A) Then
If (MsgBox(" The large number is " & C & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
Unload Me
End If
End If
End If
End Sub
Largest
End Sub
Public Sub Largest()
Dim A As Integer
Dim B As Integer
Dim C As Integer
A = Val(InputBox("Enter First No :"))
B = Val(InputBox("Enter Second No :"))
C = Val(InputBox("Enter Third No :"))
If (A > B) Then
If (MsgBox("The large number is " & A & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
If (B > C) Then
If (MsgBox(" The large number is " & B & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
If (C > A) Then
If (MsgBox(" The large number is " & C & " Do you wish to continue ?", vbYesNo) = vbYes) Then
Call Largest
Else
Unload Me
End If
Else
Unload Me
End If
End If
End If
End Sub
No comments:
Post a Comment