
Calculator!
By: a guest on
Jul 13th, 2012 | syntax:
VisualBasic | size: 0.71 KB | hits: 318 | expires: Never
Module Module1
Sub Main()
Console.WriteLine("First number:")
Dim num1 As Integer = Console.ReadLine
Console.WriteLine("Second number:")
Dim num2 As Integer = Console.ReadLine
Console.WriteLine("What Operation? (symbol only)")
Dim operation As String = Console.ReadLine
If operation = "+" Then
Console.WriteLine(num1 + num2)
ElseIf operation = "*" Then
Console.WriteLine(num1 * num2)
ElseIf operation = "-" Then
Console.WriteLine(num1 - num2)
ElseIf operation = "/" Then
Console.WriteLine(num1 / num2)
End If
Console.ReadLine()
End Sub
End Module