Application Foundation Lab 1 - Data Type Casting
Application Foundation Lab 1 - Data Type Casting
Go to Start > All Programs > Microsoft Visual Studio > Microsoft Visual Studio 2010 2. Click File | New Project | C# or VB Tab |Console Application 3. From New Project Dialog Box select Console Application, set Location to File System and set appropriate location by clicking the Browse Button, set Language to your preferred programming Language. 4. Name the Project AUCProject2 5. Open Solution Explorer, select code file 6. VB.Net Programmer jump to line 7 and C# Programmer jump to line 8 7. Write following code in Modulle.vb file: Sub Main() Dim s As Short Dim b As Byte s = 255 b = Convert.ToByte(s) Console.WriteLine(b) Console.ReadLine() End Sub 8. Write following code in Program.cs static void Main(string[] args) { short s; byte b; s = 255; b = (byte)s; Console.WriteLine(b); Console.ReadLine(); }