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 type of VB script u had done in expert view?
requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how
if the excel sheet specified in script is not there,we get run time error how to handle the error ,please anybody explain me in detail
How i can use and create Library functions in QTP and what is the proces .
Idid my qtp course in 2007 june in mind Q i for got to use this tool ,i want to mention in my resume about this ,how can i rectify this ,pls give me any idea .
How to export QTP results to an ".xls" file?
can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?
What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy paste the date from QTP help. I tryed it.But I don't Understand where should we use exactly.
hi i have one isuue on selecting webcheckbox .there are 15 wecheckboxex i want to select every time 9 th one how can i select plese help me regards balaji
Explain building blocks of the bpt framework ?
How can we export test results to an excel sheet in QTP??? Can any one provide sample coding for this?????
where is the bitmap checkpoint be saved