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 API
OPening of notedpad in QTP to write and execute the coding?
what is descriptive programming?
Your roles and responsibilities and daily tasks? (As automation tester)
In my Script Firstly i have to parametrize the data then we import the data from c drive.suppose i have parametrize the Person name and company Name and i have enter one person name and one company name in the excel sheet now we import the sheet and the script is passed i want to ask one thing can we add more than one person name and more than one company name in the excel sheet suppose firstly we create person name "ADDy" and company nmae.'Wipro" and we set the current row in the script for this data and now we want run the script another set of data so how we can run the script with another set of data
Is there any relation between Keyword Driven Framework and Recording modes provided in QTP( whether Recording modes are applied on keyword driven framework or not?)
which tpye of exceptions mostly do we face in QTP
what is option explicit? what is the use of it?
When you open QTP, how many sheets you can see?
How you can delete excel file in qtp?
how do find current links in webpage for ex: in yahoowebsite today mainpage is having 50 links and next day same page is having 60 links. if i run same programe it should display total links in webpage ?
how u conduct GUI testing and PERFORMANCE testing on MS- WORD? and What r the GUI Test Cases and performance Test Cases?
3 Answers Accenture, Civil Service, ICICI, Jintek, Satyam, Singularity, Syntel, TCS, Wipro,