|
|
 |
|
|
|
|
Visual Basic 2008 9.0 .NET Examples and Ebook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Next example will print two values and their sum. |
| Module Example
Sub Main()
Dim value1 As Integer
Dim value2 As Integer
Dim sum As Integer
value1 = 1
value2 = 2
sum = value1 + value2
Console.WriteLine(value1 & " + " & value2 & _
" = " & sum)
Console.ReadLine()
End Sub
End Module Download Broncode |
Arithmetical Operators
| The above example illustrates the use of the addition operator +.
Other arithmetical operators are : - subtraction operator - - multiplication operator * - division operator / - integral division operator \ - modulo operator Mod - exponential operator ^
All the above operators use two operands ( left and right operator ). |
Up
Concatenation Operator
| The concatenation operator & will combine two Strings ( to one String ). |
Up
Nextline Operator
| The nextline operator _ can be used to maintain readability of your code. The compiler interprets the instruction on the line following an underscore as if it was on the position of that underscore. |
Up
Multiple Declarations
| A declaration line can contain more than one variable. After the type specifier ( of the declaration of some variable ) a comma is place, followed by the declaration of the next variable. |
This version ( published on 2008-06-24 ) is printed from http://www.studyvb.com, visit the website for more recent information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|