Ticker

6/recent/ticker-posts

C Language (Primary Data Types)

DATA TYPES IN C




WHAT IS DATA TYPES?
Data types specify, how an user enter data in a C program.
Different types of data types allow different types of data to enter in C programs.

PRIMARY DATA TYPES
The primary data types are already built in data type in C language.

Char: This data type is used to enter single character (number, alphabet or special symbol)
Char Example: A, a, B, c,8, #

String: This data type is used enter set of characters and mostly used to enter name, address, so on.
String Example: User_name, Address, Date.

Integer: This data type is only used to enter numerical values. 
Integer Example: Age, Employee_no, Roll_no, etc.  


DATA TYPE
STORAGE SIZE
VALUE RANGE
SYMBOL
char
1 byte
-128 to 127 or 0 to 255
 %c
unsigned char
1 byte
0 to 255
 %c
signed char
1 byte
-128 to 127
 %c
int
2 bytes
-32,768 to 32,767
 %d
unsigned int
2 bytes
0 to 65,535
 %u
short
2 bytes
-32,768 to 32,767
 -
long
4 bytes
-2,147,483,648 to 2,147,483,647
 %ld
unsigned long
4 bytes
0 to 4,294,967,295
 -
float
4 bytes
1.2E-38 to 3.4E+38 (6 decimal places)
 %f
double
8 bytes
2.3E-308 to 1.7E+308 (15 decimal places)
 %lf
Long double
10 bytes
3.4E-4932 to 1.1E+4932 (19 decimal places)
 -
















Post a Comment

0 Comments