using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Declare an integer variable and assign an integer value
Int32 intValue = 245;
Console.WriteLine("Integer Value: " + intValue .ToString());
//Convert integer value to byte array and display it
byte[] bytes = BitConverter.GetBytes(intValue );
Console.WriteLine("Byte Array Value: " + BitConverter.ToString(bytes));
//Convert and display the byte array back to integer
double doubleValue = BitConverter.ToInt32(bytes,0);
Console.WriteLine("Byte array back to Integer: " + doubleValue.ToString());
Console.ReadLine();
}
}
}