program for
simple calculator in console application.
-----------------------------------------code---------------------------------------------------------
Module Module1
Sub Main()
Dim a,
b, c As Double
Dim ch As String
System.Console.WriteLine("Enter the value of a:")
a = System.Console.ReadLine()
System.Console.WriteLine("Enter the value of b:")
b = System.Console.ReadLine()
System.Console.WriteLine("Which operation are you perform?")
ch = System.Console.ReadLine()
Select Case ch
Case
"+"
c = a + b
System.Console.WriteLine("Addition is=" & c)
Case
"-"
c = a - b
System.Console.WriteLine("Subtraction is=" & c)
Case
"*"
c = a * b
System.Console.WriteLine("Multiplication is=" & c)
Case
"/"
c = a / b
System.Console.WriteLine("Division is=" & c)
End Select
System.Console.ReadKey()
End Sub
End Module
-----------------------------------------output----------------------------------------------------
codestrew |
No comments:
Post a Comment