Start C# here

Study C#.. Go ahead ! !

Friday, March 7, 2008

Data Types in C#

As of now we have studied how to start program using C#.

Now we will check some other programs in C#.

What do you mean by a Data Type?
In simple words Data Type means the type of data. The data may be mainly of three types. They are
Integer, Character and Float. These are also called base data types.

Integer are used to store integers or numbers without decimals.
eg:- 1,123,1452,9999 etc...

Characters are used to accept letters. Basically a character Data type can accept only one byte. So, it will store only one Letter.

eg:- a,A,b,c,d etc....
If we write -AB- it will return an error...

Float is used to accept Floating numbers or numbers with decimals..

eg:- 1.8F,21.3F etc

Some data types are :-

Name
. . . . . Description
byte . . . . .. . 8-bits '
sbyte . . . .. . 8-bits
int. . . . . . . .. 32-bit
uint. . . . . . .. 32 bit
short. . . . . ..16-bit
ushort . . . .. 16-bit
long. . . . . . .. 64-bit
ulong. . . . . .. 64-bit
float . . . . . .. 32-bit
double. . . . .. 64-bit
decimal . . . . 96-bit
bool . . . . . . . true and false
char. . . . . . . 16-bit

No comments: