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 are the views available in quicktest professional?
Without QTP (or any Testing tool) can we able to test the GUI part of the Applications. for Example generating the Scripts in Notepad and Executing them Using VB. Is it Possible to do so..
What is Descriptive Programing? In which cases, we will go for descriptive programing?
how to use the QTP choose the data from oracle? e.g. i input the identity card NO. this will be add new record in the database ,and now i want get this record's prime key.
1.how can we report the QTP test result in a different excel sheet 2.
Tell me about qtp?
How u call functions in QTP Function to calculate the length of characters in a wor
Explain the types of object repository?
What r the advantages of automation?
Hi, I am new to QTP testing and was exploring the frameworks used for automation. I wanted help in writing various scripts and files for keyword driven automation like 1. Control File 2. Test Case File 3. Startup Script 4. Driver Script 5. Utility Script . etc It would be great if someone can give help in this context ... Thanks
how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??
What are objects? how do you select the unknow object?