write a vbscrpit to swap values

Answers were Sorted based on User's Feedback



write a vbscrpit to swap values..

Answer / manjunathareddy

Dim oNum1
Dim oNum2
oNum1=Cint(InputBox("Enter the First number here"))
oNum2=Cint(InputBox("Enter the Second number here"))
Msgbox "Before swapping numbers are"&" "&oNum1&" "&oNum2
oNum1=oNum1-oNum2
oNum2=oNum1+oNum2
oNum1=oNum2-oNum1
Msgbox "After Swaping numbers are"&" "&oNum1&" "&oNum2

Is This Answer Correct ?    4 Yes 0 No

write a vbscrpit to swap values..

Answer / monika

Dim oNum1
Dim oNum2
oNum1=Cint(InputBox("Enter the First number here"))
oNum2=Cint(InputBox("Enter the Second number here"))
Msgbox "Before swapping numbers are"&" "&oNum1&" "&oNum2
oNum1=oNum1+oNum2
oNum2=oNum1-oNum2
oNum1=oNum1-oNum2
Msgbox "After Swaping numbers are"&" "&oNum1&" "&oNum2

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

0 Answers  


i want to when we will write the scripts either after getting the build or after getting the SRS?

3 Answers  


1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

0 Answers  


Is it possible to pass optional argument to function in vb script?

2 Answers  


In QTP how to insert a data base check point for web based application and simultaneous link to code in expert veiw. hw to retrieve a data(single coulumn from server) that matches with inserted value manually or exported from excel sheet.

2 Answers  






Explain about operator precedence in vb script?

0 Answers  


Mention how to assign a date value to a variable?

0 Answers  


I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?

0 Answers  


compare the string without using stringcomp function?

1 Answers   CSS Corp,


How will you convert a string to upper case string using vbscript?

0 Answers  


How can you have different number of cells for each row of a table in HTML?

2 Answers  


Explain vbscript in detail?

0 Answers  


Categories