Home > C Programming, C Tutorials > C Tutorial – Fundamental Data Types

C Tutorial – Fundamental Data Types

In this C Tutorial we will learn what Fundamental Data Types are and how to use them.

We develop programs to accept an input from the user and then run the input through a series of processes and produce the output on screen or on the printer, etc.

INPUT > PROCESS > OUTPUT

From the user’s point of view, the input supplied is data, which requires to be processed. Depending on the input provided by the user i.e. a number, fractional number, a name or an address, etc., the program must be designed to hold all these inputs. C provides the programmer with four basic or fundamental types of container to hold data, which are as follows:

Data Type Bytes Default Range
signed char 1 -128 to 127
Unsigned char 1 0 to 255
short signed int 2 -32768 to 32767
short unsigned int 2 0 to 65535
long signed int 4 -2147483648 to 2147483647
long unsigned int 4 0 to 4294967295
Float 4 -3.4e38 to +3.4e38
Double 8 -1.7e308 to +1.7e308
long double 10 -1.7e4932 to +1.7e4932




Following is the explanation of data types:

Character data type (char)

The character data type is only 1 Byte in size. It is used for only storing characters.

Integer Data type (int)

The integer data type is used to store whole numbers only. Fractional numbers are not allowed in an int data type.

Data type to store fractional numbers

float

The float data type is used to store floating point numbers or fractional numbers. This data type is 4 Bytes in size. Floating point numbers can also be expressed in the scientific notation e.g. 1.7e4 represents the number 1.7 x 104.

double

The double data type is also used to store floating point numbers or a fractional numbers. This data type is 8 Bytes in size. This data type can hold a large value.

This was about fundamental data types in c. In the subsequent C Tutorials we will learn how to use these data types by creating variables.

Subscribe now to receive updates when a new c tutorial is released.





Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/sunilb/www.sunilb.com/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:245) in /home/sunilb/www.sunilb.com/wp-content/plugins/mycaptcha/MyCaptcha.php on line 41

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/sunilb/www.sunilb.com/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:245) in /home/sunilb/www.sunilb.com/wp-content/plugins/mycaptcha/MyCaptcha.php on line 41
  1. pooshan
    August 7th, 2009 at 18:30 | #1

    once if u will send me fundamental of c languages.i will be greatfull for u for this.

  1. No trackbacks yet.
Enter this code to leave comment (Sorry, but bots get me crazy :) )