In C#.net language there are 4 types of data types and 2 of which are common because of their using in programming. These 2 commonly used data types are int and float. Now, int types are categorized into two forms these are signed and unsigned. Signed data types are those data types which can store negative value as well as positive value, but Unsigned data types can store only positive values.
The values range of the different data types as follows.
Here in the table s stands for signed data types and u stands for unsigned data types.
Now, we also need to store floating point values, for that we need float data types. There are basically three types of floating point data types and these are: float, double and decimal. Here the values range table of floating point data types:
Here three other simple types are available. These are:
C# data types are similar to Java but with little difference.
The values range of the different data types as follows.
Types | Alias | Allowed Values |
sbyte | System.SByte | -128 to 127 |
byte | System.Byte | 0 to 255 |
short | System.Int16 | -32,768 to 32,767 |
ushort | System.UInt16 | 0 to 65,535 |
int | System.Int32 | -2,147,483,648 to 2,147,483,648 |
uint | System.UInt32 | 0 to 4,294,967,295 |
long | System.Int64 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
ulong | System.UInt64 | 0 to 18,446,744,073,709,551,615 |
Here in the table s stands for signed data types and u stands for unsigned data types.
Now, we also need to store floating point values, for that we need float data types. There are basically three types of floating point data types and these are: float, double and decimal. Here the values range table of floating point data types:
Types | Alias For | App. max range | App. min range |
float | System.Single | 1.5 x 10-45 | 3.4 x 1038 |
double | System.Double | 5.0 x 10-324 | 1.7 x 10308 |
decimal | System.Decimal | 1.0 x 10-28 | 7.9 x 1028 |
Here three other simple types are available. These are:
Types | Alias for | Allowed Values |
char | System.Char | 0 to 65,535 |
bool | System.Boolean | takes only true or false |
string | System.String | takes only number or sequence of characters like "Microsoft" |
C# data types are similar to Java but with little difference.
No comments:
Post a Comment