First thing a programmer looks for is what kind of data types a programming languages has and how to use them. In this part, I will cover C# data types and how to use them in a program.
Basic Data Types
Most of the data type in c# are taken from C and C++. This tables lists data types, their description, and a sample example.
| Data Type | Description | Example |
| object | The base type of all types | object obj = null; |
| string | String type - sequence of Unicode characters | string str = "Mahesh"; |
| sbyte | 8-bit signed integral type | sbyte val = 12; |
| short | 16-bit signed integral type | short val = 12; |
| int | 32-bit signed integral type | int val = 12; |
| long | 64-bit signed integral type | long val1 = 12; long val2 = 34L; |
| bool | Boolean type; a bool value is either true or false | bool val1 = true; bool val2 = false; |
| char | Character type; a char value is a Unicode character | char val = 'h'; |
| byte | 8-bit unsigned integral type | byte val1 = 12; byte val2 = 34U; |
| ushort | 16-bit unsigned integral type | ushort val1 = 12; ushort val2 = 34U; |
| uint | 32-bit unsigned integral type | uint val1 = 12; uint val2 = 34U; |
| ulong | 64-bit unsigned integral type | ulong val1 = 12; ulong val2 = 34U; ulong val3 = 56L; ulong val4 =78UL; |
| float | Single-precision floating point type | float val = 1.23F; |
| double | Double-precision floating point type | double val1 = 1.23; double val2 = 4.56D; |
|
decimal |
Precise decimal type with 28 significant digits | decimal val= 1.23M; |

Tony YangPosted Nov 25, 2015, 1:48 AM
It's simple enough.
Abhipsa RoyPosted Mar 26, 2008, 12:47 AM
What is the difference between decimal and double data types