Your Ad Here

Friday, August 14, 2009

Variables in .Net

Variables are used to store data.
A variable has a name to which we refer and the data type, the type of data the variable holds.
VB .NET now needs variables to be declared before using them.
Variables are declared with the Dim keyword. Dim stands for Dimension.
Example
Imports System.Console
Module Module1
Sub Main()
Dim a,b,c as Integer'declaring three variables of type integer
a=10
b=20
c=a+b
Write("Sum of a and b is" & c)
End Sub
End Module

No comments:

Post a Comment

Your Ad Here