ramya


{ City } bangalore
< Country > india
* Profession * qa
User No # 112691
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 1
Questions / { ramya }
Questions Answers Category Views Company eMail




Answers / { ramya }

Question { 20949 }

X=10,Y=20 you need to swap the numbers without using a
third variable?


Answer

'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