부호 있는 정수 데이터 형식 사용: SignedInteger.cs
using System;
class SignedInteger
{
static void Main()
{
sbyte iSByte = 127;
short iInt16 = 32767;
int iInt32 = 2147483647;
long iInt64 = 9223372036854775807;
Console.WriteLine("8비트 sbyte : {0}", iSByte);
Console.WriteLine("16비트 short : {0}", iInt16);
Console.WriteLine("32비트 int : {0}", iInt32);
Console.WriteLine("64비트 long : {0}", iInt64);
}
}
실행 결과
8비트 sbyte : 127 16비트 short : 32767 32비트 int : 2147483647 64비트 long : 9223372036854775807