X=10,Y=20 you need to swap the numbers without using a
third variable?
Answers were Sorted based on User's Feedback
Answer / venki
x=10 and y=20
x=x+y
=>x=10+20=30
=>x=30
y=x-y
=>y=30-20=10
=>y=10 ----->@1
x=x-y
=>x=30-10=20
=>x=20 ----->@2
now x and y values has been swaped
see @1 and @2
Is This Answer Correct ? | 13 Yes | 0 No |
Answer / test
Dim a,b
a=10
b=20
a = a + b
b = a - b
a = a - b
Msgbox a
msgbox b
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sandip patil
If X=10 & Y=20
then for swapping just go with following
Y=Y-X i.e. Y=20-10=10 here value of Y=10
X=X+Y i.e. X=10+10=20 Here value of X=20
It is swap
Is This Answer Correct ? | 4 Yes | 3 No |
'a and b are two variables ; Following code swaps both number and string inputs
a = Inputbox("Enter a")
b = Inputbox("Enter b")
a = a + b
b = left(a,(instr(a,b)-1))
a = Right(a,(len(a)-len(b)))
msgbox "b ="&b
msgbox "a = "&a
Is This Answer Correct ? | 1 Yes | 1 No |
What is Modular framework and Keyword drive framework? Explain
Which Databases supports for QTP?
How many ways we can parameterize data in QTP?
WHAT IS THE DIFFERENCE BETWEEN QTP SCRIPT AND VB SCRIPT? HOW MUCH PERCENTAGE WE USE IN QTP SCRIPT REAL TIME AND HOW MUCH PERCEN OF VB SCRIPT,,,,,,,
what is impact analysis on regression testing?
How to remove associated function library?
What is the diff between doing parametarisation using Data Driven wizard or manually. when do we go for manual para...and when do we use Data driver wizard..can anybody answer it ..Thanks in advance
What is test automation framework?which framework does QTP follow?Need some practical explanation as to how u will start ur testing process following a particular framework?
Is there any option in QTP to add Java add-in after instaling the QTP?
Hi All, I am new to QTP but i was trained on winrunner before. My problem is..QTP 8.2 was unable to record my application which is a java app. By selecting smart identification, i was somehow able to record the test BUT QTP cant run the test! Can anyone help me in walking through this problem..Is java addin really necessary for this?? Is there anyways i can run the test successfully? I am not sure whats going wrong in my testing.Please do help me asap as i need to submit the report early. Thanks in advance
is qtp 9.2 create the scripts with the application run on mozilla firefox browser?
How should I click on the right click menu objects When I trying to add the object properties to the OR.It is showing only Window(Window).Not all the objects of the window. Also while recording I found No script. How to solve this>.