write a VB.net program to swap two numbers

Answer Posted / tarunkumar

vb.net programm to swap two numbers without using third
variable is as follows

public class form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
Dim a As integer
Dim b As integer
a=a+b
b=a-b
a=a-b
End Sub
End class

vb.net programm to swap two numbers using three variables
is as follows

public class form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
Dim a As integer
Dim b As integer
Dim temp As integer
temp=a
a=b
b=temp
End Sub
End class

this programm is written in window application because the
question tells to write vb.net programm only but not
console application

Is This Answer Correct ?    34 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain code security?

514


Name the two main parts of .net?

536


What is redim keyword and its use?

596


Tell us how many languages are supported by .net?

522


Explain the use of serialization and deserialization?

522






What are nested classes?

549


Name some of the features of C# which are not present in VB.NET?

561


Explain about Visual basic.NET culture?

604


I Am Developing A project where I can send Message from One Computer to Another Computer With The Help Of LAN.Already I Have developed..It is working Fine With The Details Of ..TO,FROM,REF No,DATE,BODY...Now I Want To Add Attachments part in the same projects...How Can I Send Attachment File & How To Send It..I Am Working in VB.Net 2005 With out Any database. Can Any One Help me ??How To Write Code??Plz Send me a copy to my Mail also...I Dont Need Any Software Available in The Internet...Plz refer me The Code in VB.Net maloy.adhikari@in.com

2220


Explain the advantages of vb.net?

535


Can you please explain the difference between int and int32?

576


How do you retrieve the customized properties of a .net application from xml .config file?

525


Explain the difference between web.config and machine.config and where it will be ?

511


What is DLL HELL in VB.NET

622


Compare c# and visual basic.net?

566