Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is global assembly cache (gac)?

1033


What is sealed class?

1199


Explain internal keyword in .net framework?

1012


Explain about visual basic.net?

1332


What are the types of generations in garbage collector?

1026


What is the differnce between managed code and unmanaged code?

1031


Explain about the ruby interface generator?

1022


Explain the advantages of migrating to vb.net?

1087


Explain manifest?

997


Explain the observations between vb.net and vc#.net?

970


Explain trace in vb.net?

1032


What is the significance of delegates. Where should they be used? What are the situations where we require them?

1022


How do you use two datareaders at the same time in a vb.net windows application ?

1118


Can you please explain the difference between dispose and finalize()?

1152


Explain the differences between vb.net and c#, related to oops concepts?

988