Program 1:
Module Data_type
Sub Main()
' defining the Data Type to the variables
Dim b As Byte = 1
Dim num As Integer = 5
Dim si As Single
Dim db As Double
Dim get_date As Date
Dim c As Char
Dim str As String
b=1
num = 20
si = 0.12
db = 2131.787
get_date = Today
c = "A"
str = "Hello Friends..."
[Link]("Welcome ")
[Link]("Byte is: {0}", b)
[Link]("Integer number is: {0}", num)
[Link]("Single data type is: {0}", si)
[Link]("Double data type is: {0}", db)
[Link]("Today is: {0}", get_date)
[Link]("Character is: {0}", b)
[Link]("String message is: {0}", str)
[Link]()
End Sub
End Module
Output:
Welcome
Byte is: 1
Integer number is: 20
Single data type is: 0.12
Double data type is: 2131.787
Today is: 31-05-2020 [Link]
Character is: 1
String message is: Hello Friends...
b. Sub Main()
Dim x As Integer = 15
Dim y As Integer = 3
' Output: x + y = 18
[Link]("x + y: {0}", x+y)
' Output: x - y = 12
[Link]("x - y: {0}", x-y)
' Output: x * y = 45
[Link]("x * y: {0}", x*y)
' Output: x / y = 5
[Link]("x / y: {0}", x/y)
' Output: x \ y = 5
[Link]("x \ y: {0}", x\y)
' Output: x MOD y = 0
[Link]("x MOD y: {0}", x Mod y)
' Output: x ^ y = 3375
[Link]("x ^ y: {0}", x^y)
End Sub
End Module
Module operators
Sub Main()
Dim x As Integer = 10
Dim y As Integer = 12
'Output: x > y is False
[Link]("x > y is:{0}", x > y)
'Output: x < y is True
[Link]("x < y is:{0}", x < y)
'Output: x = y is False
[Link]("x = y is:{0}", x = y)
'Output: x <> y is True
[Link]("x <> y is:{0}", x <> y)
'Output: x >= y is False
[Link]("x >= y is:{0}", x >= y)
'Output: x <= y is True
[Link]("x <= y is:{0}", x <= y)
End Sub
End Module
Module operators
Sub Main()
Dim x As Boolean = True
Dim y As Boolean = False
'Output: x and y is False
[Link]("x And yis:{0}", x And y)
'Output: x or y is True
[Link]("x or y is:{0}", x Or y)
'Output: not x is False
[Link]("not y is:{0}", Not y)
End Sub
End Module