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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the need for dynamic controls in vb.net? i would like to know for what purpose should we create the controls dynamically? please give the answer in simple words.

1978


What is pre-jit?

549


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

512


Using VB, how can you change the Mouse Pointer?

646


What is the Advantage of vb.net over vb

574






What is the use of errorprovider control?

607


What is the feature which is common to all .net languages?

484


Explain about Visual basic.NET culture?

604


how many server control present in .net

2304


Why do we use ansi keyword?

580


Tell us how many languages are supported by .net?

522


Explain an assembly?

583


Why do we use byref keyword in vb.net?

612


What is stack used for in vb. Net?

543


What are the features present in vb 2005?

579