using System;
//csc int_to_sbyte.cs
// value of sbyte -128 to 127
namespace dtype
{
public class dtsb
{
public int conv( int int_lss, int int_more)
{
sbyte sb1, sb2;
sb1 = (sbyte)int_lss;
sb2 = (sbyte)int_more;
Console.WriteLine("Number Less that 127 : " + sb1 + " Number More than 127: " + sb2);
return sb1 + sb2;
}
}
class test
{
static void Main()
{
dtsb d = new dtsb();
Console.Write( "Enter a number lower or equal to 127: ");
string str = Console.ReadLine();
int low = Int32.Parse(str) ;
Console.Write(" Number int_more than 127 : ");
str = Console.ReadLine();
int high = Int32.Parse( str);
d.conv(low, high);
}
}
}
|