Monday, May 6, 2013

Basic Data Types

There are basic four data types

1. char
2. int
3. float
4. double

A variable type char is 8 bits long and can hold a character.

A variable type int holds number with no fraction.(int came from the word integer). In 16 bit environment it can hold numbers valued from -32768(to keep in mind easily by (2)^(16-1) ) to + 32768. In 32 bits environment it can hold numbers valued form -2147483648(=2^(32-1) ) to +2147483647.

A variable type float and double holds numbers with fraction. The difference between float and double is that double can hold number valued twice larger than float.

  

No comments:

Post a Comment