Thursday, 27 April 2017

Calculator in VB Script



Program

varchoice=lcase(inputbox("Enter your choice of operator, a-> addition s-> subtraction, d-> divide, i->integer division, e->exponential, mo=modulus"))
var1= cdbl(inputbox("Enter the first value"))
var2= cdbl(inputbox("Enter the second value"))

select case varchoice
case "a"
msgbox (var1+var2)
case "s"
msgbox (var1-var2)
case "d"
msgbox (var1/var2)
case "i"
msgbox (var1\var2)
case "e"
msgbox (var1^var2)
case "mo"
msgbox (var1 mod var2)

end select


Video Tutorial


Step1-Open Notepad and write the program.
Step2- Save as this file- .vbs
Step3- open file and get output


No comments:

Post a Comment