how to get sum of two numbers in vb.net?

Answers were Sorted based on User's Feedback



how to get sum of two numbers in vb.net?..

Answer / rinkymishra

dim x,y,z as integer
x=(textbox1.text)
y=(textbox2.text)
z=x+y
textbox3.text=z

Is This Answer Correct ?    1 Yes 0 No

how to get sum of two numbers in vb.net?..

Answer / prashant

windows form application vb.net

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Convert.ToInt32(Me.TextBox3.Text)
b = Convert.ToInt32(Me.TextBox11.Text)
c = a * b
TextBox13.Text = c
End Sub

Is This Answer Correct ?    0 Yes 0 No

how to get sum of two numbers in vb.net?..

Answer / philip mahama

You need to create a new project and add two text-box, the first textbox, one label
Which name should be changed to sumlabel and a button for the calculation

Then double click on the button and add this code.

Dim num1, num2, sum as double

‘ Initialize sum to zero
Sum = 0

num1=double.parse(Textbox1.text)
num2=double.parse(Textbox2.text)

‘Calculate sum
Sum = num1 + num2

‘Print sum
Sumlabel.text = sum

Is This Answer Correct ?    0 Yes 0 No

how to get sum of two numbers in vb.net?..

Answer / aman

Sub Main()
Dim x, y As Integer
Console.Write("Enter value of x: ")
x = Console.ReadLine()
Console.Write("Enter value of y: ")
y = Console.ReadLine()
Console.Write("Sum x+y = ")
Console.WriteLine(x + y)
Console.ReadLine()
End Sub

Is This Answer Correct ?    5 Yes 8 No

Post New Answer

More VB.NET Interview Questions

I want to sample Hotel management project in vb.net because still now i am doing that project for small hotel....so please send me my email id is jmuthu_pearls@yahoo.com...

4 Answers   Sapphire Comfort Hotel, TATA,


Write a program that accepts an array of numbers, and two numbers (an element and a position in the array) and inserts the given element into nth position of the array.

2 Answers  


Where is the Version Information Stored on a assembly ? Write the Namespace to load assemblies at runtime Can you allow a class to be inherited but prevent the method from being overridden ? What happens in memory when you box and unbox a value type ? Write a progtam to convert decimal to byte without using library function.

2 Answers   HCL,


Can you please explain the difference between int and int32?

0 Answers  


What is the source code for display the picture in button click event?

0 Answers  






what is commom language runtime?

0 Answers  


What is difference between a panel and GroupBox ?

3 Answers   GHK,


What is the Difference between Overriding and overloading?

31 Answers   Subex, TCS,


Did vb6 support multi-threading ?

0 Answers  


Explain the difference between an xml "fragment" and an xml "document."

0 Answers  


What is the difference between value and reference types?

0 Answers  


what is vb.net

1 Answers   TCS,


Categories