76 311
Assignments Done
Successfully Done
In May 2019

Answer to Question #44375 in Visual Basic for Aden Price

Question #44375
I am working on a personal project on visual basic express 2010 and i was wondering how to add and subtract numbers together in code.
Expert's answer
´╗┐Module Module1
'main function
Sub Main()
'prompt user to enter numbers
Console.Write("Enter first number: ")
Dim firstNumber As Double = Double.Parse(Console.ReadLine())
Console.Write("Enter second number: ")
Dim secondNumber As Double = Double.Parse(Console.ReadLine())
'add two numbers
Dim sum As Double = firstNumber + secondNumber
'show sum
Console.WriteLine("Sum = " + sum.ToString())
'subtract numbers
Dim difference As Double = firstNumber - secondNumber
'show subtract
Console.WriteLine("Difference = " + difference.ToString())
End Sub

End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions