We are going to be working with this example program today.
Module constantsNenum Sub Main() Const PI = 3.14149 Dim radius, area As Single radius = 7 area = PI * radius * radius Console.WriteLine("Area = " & Str(area)) Console.ReadKey() End Sub End ModuleThis program will show you basically how to declare constants.
Dim radius, area As SingleThis line of code declares that radius and area should be Single numbers.
radius = 7This basically says that radius = 7.
area = PI * radius * radius
This declares that the variable are is PI * radius * radius.
And then at the end this outputs the area :D
No comments:
Post a Comment