Answers for "get data type c#"

C#
3

get type of variable c#

string a = "This is a string";
Console.WriteLine(a.GetType())
Posted by: Guest on May-13-2020
0

C# Data Type

short s1 = -32768;
short s2 = 32767;
short s3 = 35000;//Compile-time error: Constant value '35000' cannot be converted to a 'short'

ushort us1 = 65535;
ushort us2 = -32000; //Compile-time error: Constant value '-32000' cannot be converted to a 'ushort'

Console.WriteLine(Int16.MaxValue);//32767
Console.WriteLine(Int16.MinValue);//-32768
Console.WriteLine(UInt16.MaxValue);//65535
Console.WriteLine(UInt16.MinValue);//0
Posted by: Guest on April-23-2021

C# Answers by Framework

Browse Popular Code Answers by Language