Answered Questions

  • How to swap without third variable?

    A variable is a named location in memory that is used to store data which can be modified in a program. Let us see how to swap two variables without using third variable. This can be done in number of namely By using arithmetic operators By using Bitwise operators By using Pointers Concept and so on Let us see one of the method namely by using arithmetic operators. Consider 2 variables...

    Ramya Shetty

    • Nov 11th, 2015

    A and b are two variables ; Following code will swap 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