write a program to swap Two numbers without using temp variable.

Answer Posted / venki

In vb script...............

a=inputbox ("Enter the first value:")

b=inputbox( "Enter the second value:")

msgbox "Before swap a= "&a&" b= "&b
a=cint(a)+cint(b)
b=cint(a)-cint(b)
a=cint(a)-cint(b)
msgbox "After swap a= "&a&" b= "&b

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us bitwise shift operators?

586


explain what is an endless loop?

595


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1646


How do you use a 'Local Block'?

708


What is data types?

622






Explain what is a const pointer?

626


How do I get an accurate error status return from system on ms-dos?

633


What is the return type of sizeof?

577


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

658


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

641


When should you not use a type cast?

644


What is external variable in c?

600


Is null always equal to 0(zero)?

566


What is a class c rental property?

593


Explain the difference between structs and unions in c?

562