Facebook
From Stained Kangaroo, 2 Years ago, written in Visual Basic.
Embed
Download Paste or View Raw
Hits: 144
  1. Option Explicit
  2. Sub Max()
  3. Dim x As Single, y As Single, z As Single, v As Single
  4. x = InputBox("Enter the 1 number!")
  5. y = InputBox("Enter the 2 number!")
  6. z = InputBox("Enter the 3 number!")
  7. v = InputBox("Enter the 4 number!")
  8. MsgBox ("X: " & x & " Y: " & y & " Z: " & z & " V: " & v)
  9. If x > y Then
  10.     If x > z Then
  11.         If x > v Then
  12.         MsgBox ("the maximum is : " & x)
  13.     End If
  14.     End If
  15. Else
  16.     If y > z Then
  17.         If y > v Then
  18.         MsgBox ("the maximum is : " & y)
  19.     End If
  20.     End If
  21.    
  22.     If z > v Then
  23.     MsgBox ("the maximum is : " & z)
  24.         Else
  25.         MsgBox ("the maximum is : " & v)
  26.     End If
  27. End If
  28. End Sub
  29.  
  30.