write a VB.net program to swap two numbers
Answers were Sorted based on User's Feedback
Answer / basudev_kan
Module Basudev
Sub Main()
dim a,b,te as integer
System.console.writeline("Enter The Two Number:")
a=System.Console.ReadLine()
b=System.console.ReadLine()
System.console.WriteLine("The Two Number is:{0} And{1}:",a,b)
te=a
a=b
b=te
System.console.WriteLine("After Swapping Value is:{0} and
{1}:",a,b)
Ssytem.console.ReadLine()
End Sub
End Module
Is This Answer Correct ? | 83 Yes | 42 No |
Answer / biswasmit lenka
Private sub command1_click()
dim a,b,c as integer
a=Val(Text1.Text)
b=Val(Text1.Text)
c=a
a=b
b=c
Text1.text=b
text2.text=a
End sub
Private sub command2_click
end
End sub
Is This Answer Correct ? | 38 Yes | 12 No |
Answer / 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 |
Answer / vineetha.balan
Module Vineetha
Sub Main()
dim a,b,te as integer
System.console.writeline("Enter The Two Number:")
a=System.Console.ReadLine()
b=System.console.ReadLine()
System.console.WriteLine("The Two Number is:{0} And
{1}:",a,b)
te=a
a=b
b=te
System.console.WriteLine("After Swapping Value is:{0} and
{1}:",a,b)
System.console.ReadLine()
End Sub
End Module
Is This Answer Correct ? | 23 Yes | 13 No |
Answer / vineetha
Module Basudev
Sub Main()
dim a,b,te as integer
System.console.writeline("Enter The Two Number:")
a=System.Console.ReadLine()
b=System.console.ReadLine()
System.console.WriteLine("The Two Number is:{0} And
{1}:",a,b)
te=a
a=b
b=te
System.console.WriteLine("After Swapping Value is:{0} and
{1}:",a,b)
Sytem.console.ReadLine()
End Sub
End Module
Is This Answer Correct ? | 14 Yes | 17 No |
how to get sum of two numbers in vb.net?
14 Answers Factorial, Paul Infotech, Satyam,
code for itemstockgroupwise record?
What is redim keyword and its use?
Can you please explain the difference between authentication and authorization?
What is strong name in .net assembly?
What is deep copy?
What is the relation between Garbage collector and finalize and destructor?
What is difference between Abstract Class and Interface?
What are the features present in vb 2005?
What is the diff between vb mdi form and .net mdi form?
Name some different types of control?
What is the Difference between Web User Control and Web Custom Control?