using System;
//csc int_to_byte.cs
// value of byte ranges from 0 to 255
namespace dtype
{
public class dt
{
public int conv( int int_lss, int int_more)
{
byte b1, b2;
b1 = (byte)int_lss;
b2 = (byte)int_more;
Console.WriteLine( " No loss of Value : " + b1 + " ::" + "Los of value: " + b2);
return b1 + b2;
}
}
class test
{
static void Main()
{
dt d = new dt();
Console.Write( "Enter a number lower or equal to 255: ");
string str = Console.ReadLine();
int low = Int32.Parse(str) ;
Console.Write("Enter a Number more than 255 : ");
str = Console.ReadLine();
int high = Int32.Parse( str);
d.conv(low, high);
}
}
}
|