how to write basic programs in VB Script like addition,
multiplication?

Answers were Sorted based on User's Feedback



how to write basic programs in VB Script like addition, multiplication?..

Answer / vaibhav

function vaibhav x,y
dim x,
dim y,
dim z,
z=x*y
msgbox z

Is This Answer Correct ?    116 Yes 59 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / dev

1.addition
DIM A=10
DIM B=20
DIM C
DIM D
C=A+B
MSGBOX C (here output is 1020)

C=INT A+INT B
MSGBOX C (HERE OUTPUT IS 30)

D=A*B
MSGBOX D (OUTPUT IS 200)

Is This Answer Correct ?    84 Yes 54 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / chandra

'addition
DIM A
A=INPUTBOX("enter a val")
DIM B
B=INPUTBOX("enter b val")
DIM C
DIM D
C=A+B
MSGBOX C (here output is 1020)

C=INT (A)+INT (B)
MSGBOX C '(HERE OUTPUT IS 30)

D=A*B
MSGBOX D '(OUTPUT IS 200)

Is This Answer Correct ?    50 Yes 29 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / rohit yadav

private sub command 1_click()
text3.text=val(text1.text)+val(text2.text)
end sub

Is This Answer Correct ?    26 Yes 10 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / ramesh

dim a,b,c,d
a=inputbox ("enter the value a: ")
b=inputbox ("enter the value b: ")
c=cint(a)+ cint (b)
d=a*b
msgbox c
msgbox d

Is This Answer Correct ?    13 Yes 3 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / ashok

DIM A
A=INPUTBOX("enter a val")
DIM B
B=INPUTBOX("enter b val")
DIM C
DIM D
C=A+B
MSGBOX ("C is" &C)

C=INT (A)+INT (B)
MSGBOX ("C is" &C)

D=A*B
MSGBOX ("d is" &d)

Is This Answer Correct ?    16 Yes 11 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / chandan

'script for adding two numbers
option explicit
dim num1,num2,result
num1=200
num2=300
result=num1+num2
msgbox result

Is This Answer Correct ?    11 Yes 8 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / venkat

Dim a
Dim b
a=inputbox("enter a value")
b=inputbox("enter b value")
Dim c
c=int(a)+int(b)
Msgbox c

Is This Answer Correct ?    6 Yes 3 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / vani

dim a,b,sum,mul
a=cdbl(inputbox("enter a?"))
b=cdbl(inputbox("enter b?"))
sum=a+b
mul=a*b
msgbox sum
msgbox mul

Is This Answer Correct ?    5 Yes 4 No

how to write basic programs in VB Script like addition, multiplication?..

Answer / pravati

Call sum(x,y)
Function sum(x,y)
x=cint(inputbox ("enter a no"))
y=cint(inputbox ("enter a no"))
z=inputbox("enter the value")

Select Case z
Case "+" msgbox x+y
Case "-" msgbox x-y
End Select
End Function

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More VB Script Interview Questions

Hi all..I have two values. a=20 ,b=30 I want to perform c= a+b and c= a*b using user define function.please anyone give the answer

1 Answers  


which is the bset training centre to learn automation tools?

2 Answers  


Write a Fucntion to close all Opened browser expect desired one?

2 Answers   Ness Technologies,


what is test scenario?

1 Answers  


hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?

0 Answers   Livetek,


give me any information abou vb script books learn quckly

0 Answers  


how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

0 Answers  


How are comments handled in the vbscript language?

0 Answers  


How to select a value from a list box by using Selenium web-driver?

2 Answers   HCL,


Hi, can any one tell this Actually I AM NEW TO QTP I have one qtp script in which it calls the vbs file during it's run TIME by using the ExecuteFile "absolute path" If the vbs file is executed seperately it will give the output in a msgbox In the same way if qtp script is executed the result will be displayed in w result window right? Now the question is how to get that vbs file output in the qtp result window when I run the qtp script which calls the vbsfile during it's run TIME

1 Answers  


How do I check that the names in a weblist are correct e.g in flight application the names of item are Denver, paris,London, etc. How do I ensure the correct item is displayed from the list after doing item count ?

2 Answers   IBM,


Write a VB Script to count blank Lines in a notepad

2 Answers   IBM,


Categories