VBScript addition

Brod Blox 1 Reputation point
2021-11-29T06:57:23.827+00:00

My code looks like this:

int a = InputBox("Enter Amount 1", "Calculator", "Number")
int b = InputBox("Enter Amount 2", "Calculator", "Number")
Mode = InputBox("Enter Mode. 1 is Add, 2 is Subtract, 3 is Multiply, and 4 is Divide.", "", "1, 2, 3, 4")
Select Case Mode
Case 1
c = a+b
Case 2
c = a-b
Case 3
c = a*b
Case 4
c = a/b
End Select

x = MsgBox("The answer is: " & c, 0, "Calculator")

But when ever I add the 2 a and b variables as both of them being 5, I get 55. This should only happen when I use the ampersand symbol, right? Is there any way to fix this issue? I am using Notepad from Microsoft. I could not find a suitable tag so I just added random ones since there is no way for me to not have tags on a post.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,222 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,664 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.