Introduction to C# - slide 26 : 43 |
Option Strict On Option Explicit On Module DeclarationsDemo Sub Main() Dim ch As Char = "A"C ' A character variable Dim b As Boolean = True ' A boolean variable Dim i As Integer = 5 ' An integer variable (4 bytes) Dim s As Single = 5.5F ' A floating point number (4 bytes) Dim d As Double = 5.5 ' A floating point number (8 bytes) End Sub End Module
using System; class DeclarationsDemo{ public static void Main(){ char ch = 'A'; // A character variable bool b = true; // A boolean variable int i = 5; // An integer variable (4 byges) float s = 5.5F; // A floating point number (4 bytes) double d = 5.5 ; // A floating point number (8 bytes) } }