63 149
Assignments Done
99,1%
Successfully Done
In July 2018

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.
Thanks
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())
'delay
Console.ReadLine()
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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions