
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
What are primary data types in C language?
‘C’ compilers support four fundamental data types. They are as follows −
- Integer
- Character
- Floating − point
- Double precision floating point
Primary Data Types
Integral data type
Integral data types are used to store whole numbers and characters.
It is further classified into two types −
- Integer data type.
- Character data type.
Integer data type
This data type is used to store whole numbers.
The integer storage are short int, int and long int in both signed and unsigned forms.
Integer Data Types | |||
---|---|---|---|
Type | size(in bytes) | Range | Control String |
short in (or) signed short int | 1 | -128 to 127 | %h |
unsigned short int | 1 | 0 to 255 | %uh |
int (or) signed int | 4 | -32768 to 32767 | %d or %i |
unsigned int | 4 | 0 to 65535 | %u |
Long int (or) signed long int | 4 | -2147483648 to 2147483647 | %ld |
Unsigned long int | 4 | 0 to 4294967295 | %lu |
Character data type
Character data type is used to store characters only.
These characters are internally stored as integers.
Each character has an equivalent ASCII value.
For example, ‘A’ has ASCII value 65.
Character Data Types | |||
---|---|---|---|
Type | Size(in bytes) | Range | Control String |
Char(or) signed Char | 1 | -128 to 127 | %C |
unsigned Char | 1 | 0 to 255 | %c |
Floating - point Data type
Floating point data types are used to store real numbers.
float’ is used for 6 digits of accuracy.
‘double' is used for 12 digits of accuracy.
More than 12 digits, ‘long double’ is used.
Floating Point Data Types | |||
---|---|---|---|
Type | size(in bytes) | Range | Control String |
float | 4 | 3.4E - 38 to 3.4 E + 38 | %f |
double | 8 | 1.7 E - 308 to 1.7 E + 308 | %lf |
long double | 16 | 3.4 E - 4932 to 1.1 E + 4932 | %Lf |
- Related Articles
- What are different types of data in C language?
- What are types of expressions evaluated in C Language?
- What are different types of constants in C language?
- What are enumerated data types in C++?
- What are pointer data types in C#?
- What are nullable data types in C#?
- What are dynamic data types in C#?
- What are object data types in C#?
- What are reference data types in C#?
- What are the different types of pointers in C language?
- What are the different types of keywords in C language?
- What are the data types, value types and reference types in C#?
- What are fundamental data types in C++ programming?
- What are user defined data types in C#?
- What are string and String data types in C#?

Advertisements