Don't like ads? PRO users don't see any ads ;-)
Guest

Calculator!

By: a guest on Jul 13th, 2012  |  syntax: VisualBasic  |  size: 0.71 KB  |  hits: 318  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Console.WriteLine("First number:")
  5.         Dim num1 As Integer = Console.ReadLine
  6.         Console.WriteLine("Second number:")
  7.         Dim num2 As Integer = Console.ReadLine
  8.         Console.WriteLine("What Operation? (symbol only)")
  9.         Dim operation As String = Console.ReadLine
  10.         If operation = "+" Then
  11.             Console.WriteLine(num1 + num2)
  12.         ElseIf operation = "*" Then
  13.             Console.WriteLine(num1 * num2)
  14.         ElseIf operation = "-" Then
  15.             Console.WriteLine(num1 - num2)
  16.         ElseIf operation = "/" Then
  17.             Console.WriteLine(num1 / num2)
  18.         End If
  19.         Console.ReadLine()
  20.        
  21.     End Sub
  22.  
  23. End Module