fork download
  1. Imports system
  2.  
  3. Module MyProgram
  4.  
  5. Public Sub Main()
  6. ' ## Visual Basic .NET representation result ##
  7.  
  8. 'IMPORTANT! Always manually review translated scripts before excecution
  9.  
  10. Dim MyNum As Decimal
  11. Console.WriteLine("Please enter your number:")
  12. MyNum = CDec(Console.ReadLine())
  13. Console.WriteLine("The absolute value of " & MyNum & " is " & MyAbs(MyNum) & ".")
  14. End Sub
  15.  
  16. Function MyAbs(num As Decimal) As Decimal
  17. If num < 0 Then
  18. Return -num
  19. Else
  20. Return num
  21. End If
  22. End Function
  23.  
  24. End Module
Success #stdin #stdout 0.03s 23228KB
stdin
Standard input is empty
stdout
Please enter your number:
The absolute value of 0 is 0.